aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/walletdb.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-03-08 11:48:58 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2017-04-20 17:15:30 +0200
commit71afe3c0995592ff17968816a833a8ed3ce05bf2 (patch)
tree84df1ac80d58db77464e500bf152a41bace9a4ac /src/wallet/walletdb.h
parent987a6c09562e1e1e9d6623b999ae9de268490e4b (diff)
downloadbitcoin-71afe3c0995592ff17968816a833a8ed3ce05bf2.tar.xz
wallet: Introduce database handle wrapper
Abstract database handle from explicit strFilename into CWalletDBWrapper. Also move CWallet::Backup to db.cpp - as it deals with representation details this is a database specific operation.
Diffstat (limited to 'src/wallet/walletdb.h')
-rw-r--r--src/wallet/walletdb.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/wallet/walletdb.h b/src/wallet/walletdb.h
index b94f341b2e..c0135a6292 100644
--- a/src/wallet/walletdb.h
+++ b/src/wallet/walletdb.h
@@ -118,11 +118,15 @@ public:
}
};
-/** Access to the wallet database */
+/** Access to the wallet database.
+ * This should really be named CWalletDBBatch, as it represents a single transaction at the
+ * database. It will be committed when the object goes out of scope.
+ * Optionally (on by default) it will flush to disk as well.
+ */
class CWalletDB : public CDB
{
public:
- CWalletDB(const std::string& strFilename, const char* pszMode = "r+", bool _fFlushOnClose = true) : CDB(strFilename, pszMode, _fFlushOnClose)
+ CWalletDB(CWalletDBWrapper& dbw, const char* pszMode = "r+", bool _fFlushOnClose = true) : CDB(dbw, pszMode, _fFlushOnClose)
{
}