return tx, nil
}
-// GetGlobalTransaction get global tx by txID
-func (store *WalletStore) GetGlobalTransaction(txID string) []byte {
+// GetGlobalTransactionIndex get global tx by txID
+func (store *WalletStore) GetGlobalTransactionIndex(txID string) []byte {
return store.walletDB.Get(calcGlobalTxIndexKey(txID))
}
}
func (w *Wallet) getGlobalTxByTxID(txID string) (*query.AnnotatedTx, error) {
- globalTxIdx := w.store.GetGlobalTransaction(txID)
+ globalTxIdx := w.store.GetGlobalTransactionIndex(txID)
if globalTxIdx == nil {
return nil, fmt.Errorf("No transaction(tx_id=%s) ", txID)
}
SetGlobalTransactionIndex(string, *bc.Hash, uint64)
GetStandardUTXO(bc.Hash) (*acc.UTXO, error)
GetTransaction(string) (*query.AnnotatedTx, error)
- GetGlobalTransaction(string) []byte
+ GetGlobalTransactionIndex(string) []byte
GetTransactions() ([]*query.AnnotatedTx, error)
GetUnconfirmedTransactions() ([]*query.AnnotatedTx, error)
GetUnconfirmedTransaction(string) []byte
}
for position, tx := range block.Transactions {
- get := w.store.GetGlobalTransaction(tx.ID.String())
+ get := w.store.GetGlobalTransactionIndex(tx.ID.String())
bh := block.BlockHeader.Hash()
expect := database.CalcGlobalTxIndex(&bh, uint64(position))
if !reflect.DeepEqual(get, expect) {