aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/walletdb.cpp
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.cpp
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.cpp')
-rw-r--r--src/wallet/walletdb.cpp5
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;
}
+