diff options
author | Gregory Maxwell <greg@xiph.org> | 2015-11-20 18:36:58 -0800 |
---|---|---|
committer | Gregory Maxwell <greg@xiph.org> | 2015-11-20 18:52:44 -0800 |
commit | 616d61b20d56c0645412884df441eba781ec565d (patch) | |
tree | 30c7e6299d5718510524401fbd0aa369605782b5 /src/wallet/walletdb.cpp | |
parent | 776848acefa8345c7e510d31406160c4a1a24bca (diff) | |
parent | 3e7c89196ceb2742b62cd183d6fab74edc40647a (diff) | |
download | bitcoin-616d61b20d56c0645412884df441eba781ec565d.tar.xz |
Merge pull request #6851
3e7c891 Optimisation: Store transaction list order in memory rather than compute it every need (Luke Dashjr)
Diffstat (limited to 'src/wallet/walletdb.cpp')
-rw-r--r-- | src/wallet/walletdb.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index ea8a4eb043..9ce9f53bd9 100644 --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -191,7 +191,7 @@ bool CWalletDB::WriteAccountingEntry(const uint64_t nAccEntryNum, const CAccount return Write(std::make_pair(std::string("acentry"), std::make_pair(acentry.strAccount, nAccEntryNum)), acentry); } -bool CWalletDB::WriteAccountingEntry(const CAccountingEntry& acentry) +bool CWalletDB::WriteAccountingEntry_Backend(const CAccountingEntry& acentry) { return WriteAccountingEntry(++nAccountingEntryNumber, acentry); } @@ -709,6 +709,12 @@ DBErrors CWalletDB::LoadWallet(CWallet* pwallet) if (wss.fAnyUnordered) result = ReorderTransactions(pwallet); + pwallet->laccentries.clear(); + ListAccountCreditDebit("*", pwallet->laccentries); + BOOST_FOREACH(CAccountingEntry& entry, pwallet->laccentries) { + pwallet->wtxOrdered.insert(make_pair(entry.nOrderPos, CWallet::TxPair((CWalletTx*)0, &entry))); + } + return result; } |