aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/bdb.cpp6
-rw-r--r--src/wallet/bdb.h7
-rw-r--r--src/wallet/walletdb.cpp2
3 files changed, 6 insertions, 9 deletions
diff --git a/src/wallet/bdb.cpp b/src/wallet/bdb.cpp
index b09337b5a6..4856f4bff8 100644
--- a/src/wallet/bdb.cpp
+++ b/src/wallet/bdb.cpp
@@ -614,14 +614,12 @@ void BerkeleyEnvironment::Flush(bool fShutdown)
}
}
-bool BerkeleyBatch::PeriodicFlush(BerkeleyDatabase& database)
+bool BerkeleyDatabase::PeriodicFlush()
{
- if (database.IsDummy()) {
+ if (IsDummy()) {
return true;
}
bool ret = false;
- BerkeleyEnvironment *env = database.env.get();
- const std::string& strFile = database.strFile;
TRY_LOCK(cs_db, lockDb);
if (lockDb)
{
diff --git a/src/wallet/bdb.h b/src/wallet/bdb.h
index f8ecdd75d4..d15efc810f 100644
--- a/src/wallet/bdb.h
+++ b/src/wallet/bdb.h
@@ -131,6 +131,9 @@ public:
/** Make sure all changes are flushed to disk.
*/
void Flush(bool shutdown);
+ /* flush the wallet passively (TRY_LOCK)
+ ideal to be called periodically */
+ bool PeriodicFlush();
void IncrementUpdateCounter();
@@ -215,10 +218,6 @@ public:
void Flush();
void Close();
- /* flush the wallet passively (TRY_LOCK)
- ideal to be called periodically */
- static bool PeriodicFlush(BerkeleyDatabase& database);
-
template <typename K, typename T>
bool Read(const K& key, T& value)
{
diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp
index 1c7649de67..0879f2d66e 100644
--- a/src/wallet/walletdb.cpp
+++ b/src/wallet/walletdb.cpp
@@ -964,7 +964,7 @@ void MaybeCompactWalletDB()
}
if (dbh.nLastFlushed != nUpdateCounter && GetTime() - dbh.nLastWalletUpdate >= 2) {
- if (BerkeleyBatch::PeriodicFlush(dbh)) {
+ if (dbh.PeriodicFlush()) {
dbh.nLastFlushed = nUpdateCounter;
}
}