diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp index 6c5522e4b..e9710012b 100644 --- a/src/wallet/init.cpp +++ b/src/wallet/init.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -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 diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index f9f567009..4d3e3813a 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -23,7 +23,6 @@ #include #include #include