aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/walletdb.cpp
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2017-03-09 20:11:36 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2017-06-05 21:04:42 +0000
commit23fb9adaea01c7baece6e1269e65713571088c5f (patch)
treea5d502424da92afc409064d65627fcacc6cb8d20 /src/wallet/walletdb.cpp
parent9d15d5548d375e7841e0505cdcf4ddcf11591994 (diff)
wallet: Move nAccountingEntryNumber from static/global to CWallet
Diffstat (limited to 'src/wallet/walletdb.cpp')
-rw-r--r--src/wallet/walletdb.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp
index f0d7f44ec0..75dbb2edff 100644
--- a/src/wallet/walletdb.cpp
+++ b/src/wallet/walletdb.cpp
@@ -22,8 +22,6 @@
#include <boost/foreach.hpp>
#include <boost/thread.hpp>
-static uint64_t nAccountingEntryNumber = 0;
-
static std::atomic<unsigned int> nWalletDBUpdateCounter;
//
@@ -180,11 +178,6 @@ bool CWalletDB::WriteAccountingEntry(const uint64_t nAccEntryNum, const CAccount
return WriteIC(std::make_pair(std::string("acentry"), std::make_pair(acentry.strAccount, nAccEntryNum)), acentry);
}
-bool CWalletDB::WriteAccountingEntry_Backend(const CAccountingEntry& acentry)
-{
- return WriteAccountingEntry(++nAccountingEntryNumber, acentry);
-}
-
CAmount CWalletDB::GetAccountCreditDebit(const std::string& strAccount)
{
std::list<CAccountingEntry> entries;
@@ -321,8 +314,9 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
ssKey >> strAccount;
uint64_t nNumber;
ssKey >> nNumber;
- if (nNumber > nAccountingEntryNumber)
- nAccountingEntryNumber = nNumber;
+ if (nNumber > pwallet->nAccountingEntryNumber) {
+ pwallet->nAccountingEntryNumber = nNumber;
+ }
if (!wss.fAnyUnordered)
{