aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2012-09-02 16:47:58 -0700
committerGavin Andresen <gavinandresen@gmail.com>2012-09-02 16:47:58 -0700
commiteaf00a3a5d80fb50d761c14b7c295df6ae2f0e44 (patch)
tree92c402e1cf3352c8079af84cc60f5129ffeb1d6f /src/wallet.cpp
parent4d0c2b6cf4e0d3ece4e785af442e8d5538770048 (diff)
parentddb709e9de1490afcfa1af045517d2228d5b864c (diff)
Merge pull request #1774 from luke-jr/refactor_times
Bugfix: Require OrderedTxItems to provide properly scoped accounting entry list
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r--src/wallet.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp
index dc019d4924..6538ca9713 100644
--- a/src/wallet.cpp
+++ b/src/wallet.cpp
@@ -291,8 +291,7 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
return true;
}
-CWallet::TxItems
-CWallet::OrderedTxItems(std::string strAccount)
+CWallet::TxItems CWallet::OrderedTxItems(std::list<CAccountingEntry>& acentries, std::string strAccount)
{
CWalletDB walletdb(strWalletFile);
@@ -306,7 +305,7 @@ CWallet::OrderedTxItems(std::string strAccount)
CWalletTx* wtx = &((*it).second);
txOrdered.insert(make_pair(wtx->nOrderPos, TxPair(wtx, (CAccountingEntry*)0)));
}
- list<CAccountingEntry> acentries;
+ acentries.clear();
walletdb.ListAccountCreditDebit(strAccount, acentries);
BOOST_FOREACH(CAccountingEntry& entry, acentries)
{
@@ -375,7 +374,8 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn)
{
// Tolerate times up to the last timestamp in the wallet not more than 5 minutes into the future
int64 latestTolerated = latestNow + 300;
- TxItems txOrdered = OrderedTxItems();
+ std::list<CAccountingEntry> acentries;
+ TxItems txOrdered = OrderedTxItems(acentries);
for (TxItems::reverse_iterator it = txOrdered.rbegin(); it != txOrdered.rend(); ++it)
{
CWalletTx *const pwtx = (*it).second.first;