OSDN Git Service
(root)
/
bytom
/
vapor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add log (#373)
[bytom/vapor.git]
/
database
/
wallet_store.go
diff --git
a/database/wallet_store.go
b/database/wallet_store.go
index
85eb2e1
..
c0bf9f9
100644
(file)
--- a/
database/wallet_store.go
+++ b/
database/wallet_store.go
@@
-190,7
+190,7
@@
func (store *WalletStore) DeleteWalletTransactions() {
}
}
}
}
-// DeleteWalletUTXOs delete all
tx
s in wallet
+// DeleteWalletUTXOs delete all
utxo
s in wallet
func (store *WalletStore) DeleteWalletUTXOs() {
batch := store.db.NewBatch()
if store.batch != nil {
func (store *WalletStore) DeleteWalletUTXOs() {
batch := store.db.NewBatch()
if store.batch != nil {
@@
-246,7
+246,7
@@
func (store *WalletStore) GetGlobalTransactionIndex(txID string) []byte {
func (store *WalletStore) GetStandardUTXO(outid bc.Hash) (*acc.UTXO, error) {
rawUTXO := store.db.Get(StandardUTXOKey(outid))
if rawUTXO == nil {
func (store *WalletStore) GetStandardUTXO(outid bc.Hash) (*acc.UTXO, error) {
rawUTXO := store.db.Get(StandardUTXOKey(outid))
if rawUTXO == nil {
- return nil,
fmt.Errorf("failed get standard UTXO, outputID: %s ", outid.String())
+ return nil,
wallet.ErrGetStandardUTXO
}
UTXO := new(acc.UTXO)
}
UTXO := new(acc.UTXO)
@@
-342,6
+342,7
@@
func (store *WalletStore) ListAccountUTXOs(id string, isSmartContract bool) ([]*
confirmedUTXOs = append(confirmedUTXOs, utxo)
}
confirmedUTXOs = append(confirmedUTXOs, utxo)
}
+
return confirmedUTXOs, nil
}
return confirmedUTXOs, nil
}
@@
-376,8
+377,10
@@
func (store *WalletStore) ListTransactions(accountID string, StartTxID string, c
return nil, err
}
return nil, err
}
- annotatedTxs = append(annotatedTxs, annotatedTx)
- txNum--
+ if accountID == "" || wallet.FindTransactionsByAccount(annotatedTx, accountID) {
+ annotatedTxs = append([]*query.AnnotatedTx{annotatedTx}, annotatedTxs...)
+ txNum--
+ }
}
return annotatedTxs, nil
}
return annotatedTxs, nil