From 19b3648bb52d27c3a9674159d71726b73fe532d9 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 9 Mar 2017 20:56:58 +0000 Subject: CWalletDB: Store the update counter per wallet --- src/wallet/walletdb.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/wallet/walletdb.h') diff --git a/src/wallet/walletdb.h b/src/wallet/walletdb.h index 5f9aec9afd..64cebd4330 100644 --- a/src/wallet/walletdb.h +++ b/src/wallet/walletdb.h @@ -147,7 +147,7 @@ private: if (!batch.Write(key, value, fOverwrite)) { return false; } - IncrementUpdateCounter(); + m_dbw.IncrementUpdateCounter(); return true; } @@ -157,13 +157,14 @@ private: if (!batch.Erase(key)) { return false; } - IncrementUpdateCounter(); + m_dbw.IncrementUpdateCounter(); return true; } public: CWalletDB(CWalletDBWrapper& dbw, const char* pszMode = "r+", bool _fFlushOnClose = true) : - batch(dbw, pszMode, _fFlushOnClose) + batch(dbw, pszMode, _fFlushOnClose), + m_dbw(dbw) { } @@ -232,9 +233,6 @@ public: //! write the hdchain model (external chain child index counter) bool WriteHDChain(const CHDChain& chain); - static void IncrementUpdateCounter(); - static unsigned int GetUpdateCounter(); - //! Begin a new transaction bool TxnBegin(); //! Commit current transaction @@ -247,6 +245,7 @@ public: bool WriteVersion(int nVersion); private: CDB batch; + CWalletDBWrapper& m_dbw; CWalletDB(const CWalletDB&); void operator=(const CWalletDB&); -- cgit v1.2.3