aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/walletdb.h
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2017-03-09 20:56:58 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2017-06-05 22:27:57 +0000
commit19b3648bb52d27c3a9674159d71726b73fe532d9 (patch)
tree06736b4b84033fdffe3e820a1d1ab40fa91b14ec /src/wallet/walletdb.h
parent74e87389616ce1147c65f0e49f3d84b817693ac6 (diff)
CWalletDB: Store the update counter per wallet
Diffstat (limited to 'src/wallet/walletdb.h')
-rw-r--r--src/wallet/walletdb.h11
1 files changed, 5 insertions, 6 deletions
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&);