aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/init.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/init.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/init.cpp')
-rw-r--r--src/wallet/init.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp
index 6c5522e4bc..e9710012b5 100644
--- a/src/wallet/init.cpp
+++ b/src/wallet/init.cpp
@@ -6,6 +6,7 @@
#include <chainparams.h>
#include <init.h>
#include <net.h>
+#include <scheduler.h>
#include <util.h>
#include <utilmoneystr.h>
#include <validation.h>
@@ -264,8 +265,11 @@ bool WalletInit::Open() const
void WalletInit::Start(CScheduler& scheduler) const
{
for (CWallet* pwallet : GetWallets()) {
- pwallet->postInitProcess(scheduler);
+ pwallet->postInitProcess();
}
+
+ // Run a thread to flush wallet periodically
+ scheduler.scheduleEvery(MaybeCompactWalletDB, 500);
}
void WalletInit::Flush() const