diff options
Diffstat (limited to 'src/wallet/walletdb.h')
-rw-r--r-- | src/wallet/walletdb.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/wallet/walletdb.h b/src/wallet/walletdb.h index cd9fe279c5..0fafdb6a1b 100644 --- a/src/wallet/walletdb.h +++ b/src/wallet/walletdb.h @@ -140,6 +140,27 @@ public: */ class CWalletDB { +private: + template <typename K, typename T> + bool WriteIC(const K& key, const T& value, bool fOverwrite = true) + { + if (!batch.Write(key, value, fOverwrite)) { + return false; + } + IncrementUpdateCounter(); + return true; + } + + template <typename K> + bool EraseIC(const K& key) + { + if (!batch.Erase(key)) { + return false; + } + IncrementUpdateCounter(); + return true; + } + public: CWalletDB(CWalletDBWrapper& dbw, const char* pszMode = "r+", bool _fFlushOnClose = true) : batch(dbw, pszMode, _fFlushOnClose) |