Skip to content

Commit fa7b164

Browse files
author
MarcoFalke
committed
wallet: Never schedule MaybeCompactWalletDB when -flushwallet is off
1 parent faf8401 commit fa7b164

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/wallet/load.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <util/system.h>
1212
#include <util/translation.h>
1313
#include <wallet/wallet.h>
14+
#include <wallet/walletdb.h>
1415

1516
bool VerifyWallets(interfaces::Chain& chain, const std::vector<std::string>& wallet_files)
1617
{
@@ -89,7 +90,9 @@ void StartWallets(CScheduler& scheduler, const ArgsManager& args)
8990
}
9091

9192
// Schedule periodic wallet flushes and tx rebroadcasts
92-
scheduler.scheduleEvery(MaybeCompactWalletDB, std::chrono::milliseconds{500});
93+
if (args.GetBoolArg("-flushwallet", DEFAULT_FLUSHWALLET)) {
94+
scheduler.scheduleEvery(MaybeCompactWalletDB, std::chrono::milliseconds{500});
95+
}
9396
scheduler.scheduleEvery(MaybeResendWalletTxs, std::chrono::milliseconds{1000});
9497
}
9598

src/wallet/walletdb.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -952,9 +952,6 @@ void MaybeCompactWalletDB()
952952
if (fOneThread.exchange(true)) {
953953
return;
954954
}
955-
if (!gArgs.GetBoolArg("-flushwallet", DEFAULT_FLUSHWALLET)) {
956-
return;
957-
}
958955

959956
for (const std::shared_ptr<CWallet>& pwallet : GetWallets()) {
960957
WalletDatabase& dbh = pwallet->GetDBHandle();

0 commit comments

Comments
 (0)