aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2018-04-19 17:42:40 -0400
committerJohn Newbery <john@johnnewbery.com>2018-05-15 13:28:29 -0400
commit470316c3bf5ca343d5d66b94839169a4572eceb7 (patch)
tree613ee4efd5748ce3356dfa4332c1b1b2b5c9ae1a /src/wallet/wallet.cpp
parent59b87a27efea819e433c727756bf5fac57b33dd6 (diff)
downloadbitcoin-470316c3bf5ca343d5d66b94839169a4572eceb7.tar.xz
[wallet] setup wallet background flushing in WalletInit directly
WalletInit::Start calls postInitProcess() for each wallet. Previously each call to postInitProcess() would attempt to schedule wallet background flushing. Just start wallet background flushing once from WalletInit::Start().
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index f9f567009a..4d3e3813af 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -23,7 +23,6 @@
#include <primitives/block.h>
#include <primitives/transaction.h>
#include <script/script.h>
-#include <scheduler.h>
#include <timedata.h>
#include <txmempool.h>
#include <utilmoneystr.h>
@@ -4308,18 +4307,11 @@ CWallet* CWallet::CreateWalletFromFile(const std::string& name, const fs::path&
return walletInstance;
}
-std::atomic<bool> CWallet::fFlushScheduled(false);
-
-void CWallet::postInitProcess(CScheduler& scheduler)
+void CWallet::postInitProcess()
{
// Add wallet transactions that aren't already in a block to mempool
// Do this here as mempool requires genesis block to be loaded
ReacceptWalletTransactions();
-
- // Run a thread to flush wallet periodically
- if (!CWallet::fFlushScheduled.exchange(true)) {
- scheduler.scheduleEvery(MaybeCompactWalletDB, 500);
- }
}
bool CWallet::BackupWallet(const std::string& strDest)