aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/load.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-05-11 17:49:05 +0200
committerMarcoFalke <falke.marco@gmail.com>2020-07-09 13:07:41 +0200
commitfa7b164d62d9f12e9cda79bf28bf435acf2d1e38 (patch)
tree723d4f7a00cb33b2d132385572cd83453b123203 /src/wallet/load.cpp
parentfaf8401c195f52470d1ca6e2c94cb3820e57ee41 (diff)
downloadbitcoin-fa7b164d62d9f12e9cda79bf28bf435acf2d1e38.tar.xz
wallet: Never schedule MaybeCompactWalletDB when -flushwallet is off
Diffstat (limited to 'src/wallet/load.cpp')
-rw-r--r--src/wallet/load.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wallet/load.cpp b/src/wallet/load.cpp
index 66fc98eaaf..c2818a41e7 100644
--- a/src/wallet/load.cpp
+++ b/src/wallet/load.cpp
@@ -11,6 +11,7 @@
#include <util/system.h>
#include <util/translation.h>
#include <wallet/wallet.h>
+#include <wallet/walletdb.h>
bool VerifyWallets(interfaces::Chain& chain, const std::vector<std::string>& wallet_files)
{
@@ -89,7 +90,9 @@ void StartWallets(CScheduler& scheduler, const ArgsManager& args)
}
// Schedule periodic wallet flushes and tx rebroadcasts
- scheduler.scheduleEvery(MaybeCompactWalletDB, std::chrono::milliseconds{500});
+ if (args.GetBoolArg("-flushwallet", DEFAULT_FLUSHWALLET)) {
+ scheduler.scheduleEvery(MaybeCompactWalletDB, std::chrono::milliseconds{500});
+ }
scheduler.scheduleEvery(MaybeResendWalletTxs, std::chrono::milliseconds{1000});
}