diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-03-08 11:48:58 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-04-20 17:15:30 +0200 |
commit | 71afe3c0995592ff17968816a833a8ed3ce05bf2 (patch) | |
tree | 84df1ac80d58db77464e500bf152a41bace9a4ac /src/wallet/walletdb.cpp | |
parent | 987a6c09562e1e1e9d6623b999ae9de268490e4b (diff) | |
download | bitcoin-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.cpp')
-rw-r--r-- | src/wallet/walletdb.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index ceff2d36e3..6921c9900b 100644 --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -797,9 +797,9 @@ void MaybeCompactWalletDB() if (nLastFlushed != CWalletDB::GetUpdateCounter() && GetTime() - nLastWalletUpdate >= 2) { - const std::string& strFile = pwalletMain->strWalletFile; - if (CDB::PeriodicFlush(strFile)) + if (CDB::PeriodicFlush(pwalletMain->GetDBHandle())) { nLastFlushed = CWalletDB::GetUpdateCounter(); + } } fOneThread = false; } @@ -880,3 +880,4 @@ unsigned int CWalletDB::GetUpdateCounter() { return nWalletDBUpdateCounter; } + |