|
|
@ -147,7 +147,7 @@ private: |
|
|
|
if (!batch.Write(key, value, fOverwrite)) { |
|
|
|
if (!batch.Write(key, value, fOverwrite)) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
IncrementUpdateCounter(); |
|
|
|
m_dbw.IncrementUpdateCounter(); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -157,13 +157,14 @@ private: |
|
|
|
if (!batch.Erase(key)) { |
|
|
|
if (!batch.Erase(key)) { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
IncrementUpdateCounter(); |
|
|
|
m_dbw.IncrementUpdateCounter(); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public: |
|
|
|
public: |
|
|
|
CWalletDB(CWalletDBWrapper& dbw, const char* pszMode = "r+", bool _fFlushOnClose = true) : |
|
|
|
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)
|
|
|
|
//! write the hdchain model (external chain child index counter)
|
|
|
|
bool WriteHDChain(const CHDChain& chain); |
|
|
|
bool WriteHDChain(const CHDChain& chain); |
|
|
|
|
|
|
|
|
|
|
|
static void IncrementUpdateCounter(); |
|
|
|
|
|
|
|
static unsigned int GetUpdateCounter(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//! Begin a new transaction
|
|
|
|
//! Begin a new transaction
|
|
|
|
bool TxnBegin(); |
|
|
|
bool TxnBegin(); |
|
|
|
//! Commit current transaction
|
|
|
|
//! Commit current transaction
|
|
|
@ -247,6 +245,7 @@ public: |
|
|
|
bool WriteVersion(int nVersion); |
|
|
|
bool WriteVersion(int nVersion); |
|
|
|
private: |
|
|
|
private: |
|
|
|
CDB batch; |
|
|
|
CDB batch; |
|
|
|
|
|
|
|
CWalletDBWrapper& m_dbw; |
|
|
|
|
|
|
|
|
|
|
|
CWalletDB(const CWalletDB&); |
|
|
|
CWalletDB(const CWalletDB&); |
|
|
|
void operator=(const CWalletDB&); |
|
|
|
void operator=(const CWalletDB&); |
|
|
|