X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=database%2Fwallet_store.go;h=c0bf9f93d8da5f5b12d51ba24ddbbcd4875a05b3;hb=refs%2Fheads%2Fadd_log_for_votereward;hp=b810e46a756bf0d019b96ae7a50999ffbd16cffb;hpb=489e57ce3c46eb9e8ca25c7e966a1ea26fe41d57;p=bytom%2Fvapor.git diff --git a/database/wallet_store.go b/database/wallet_store.go index b810e46a..c0bf9f93 100644 --- a/database/wallet_store.go +++ b/database/wallet_store.go @@ -190,7 +190,7 @@ func (store *WalletStore) DeleteWalletTransactions() { } } -// DeleteWalletUTXOs delete all txs in wallet +// DeleteWalletUTXOs delete all utxos in wallet func (store *WalletStore) DeleteWalletUTXOs() { batch := store.db.NewBatch() if store.batch != nil { @@ -342,6 +342,7 @@ func (store *WalletStore) ListAccountUTXOs(id string, isSmartContract bool) ([]* confirmedUTXOs = append(confirmedUTXOs, utxo) } + return confirmedUTXOs, nil } @@ -376,8 +377,10 @@ func (store *WalletStore) ListTransactions(accountID string, StartTxID string, c return nil, err } - annotatedTxs = append(annotatedTxs, annotatedTx) - txNum-- + if accountID == "" || wallet.FindTransactionsByAccount(annotatedTx, accountID) { + annotatedTxs = append([]*query.AnnotatedTx{annotatedTx}, annotatedTxs...) + txNum-- + } } return annotatedTxs, nil