mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-20 03:39:48 +02:00
[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().
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user