wallet: Never schedule MaybeCompactWalletDB when -flushwallet is off
This commit is contained in:
parent
faf8401c19
commit
fa7b164d62
2 changed files with 4 additions and 4 deletions
|
@ -11,6 +11,7 @@
|
||||||
#include <util/system.h>
|
#include <util/system.h>
|
||||||
#include <util/translation.h>
|
#include <util/translation.h>
|
||||||
#include <wallet/wallet.h>
|
#include <wallet/wallet.h>
|
||||||
|
#include <wallet/walletdb.h>
|
||||||
|
|
||||||
bool VerifyWallets(interfaces::Chain& chain, const std::vector<std::string>& wallet_files)
|
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
|
// Schedule periodic wallet flushes and tx rebroadcasts
|
||||||
|
if (args.GetBoolArg("-flushwallet", DEFAULT_FLUSHWALLET)) {
|
||||||
scheduler.scheduleEvery(MaybeCompactWalletDB, std::chrono::milliseconds{500});
|
scheduler.scheduleEvery(MaybeCompactWalletDB, std::chrono::milliseconds{500});
|
||||||
|
}
|
||||||
scheduler.scheduleEvery(MaybeResendWalletTxs, std::chrono::milliseconds{1000});
|
scheduler.scheduleEvery(MaybeResendWalletTxs, std::chrono::milliseconds{1000});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -952,9 +952,6 @@ void MaybeCompactWalletDB()
|
||||||
if (fOneThread.exchange(true)) {
|
if (fOneThread.exchange(true)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!gArgs.GetBoolArg("-flushwallet", DEFAULT_FLUSHWALLET)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const std::shared_ptr<CWallet>& pwallet : GetWallets()) {
|
for (const std::shared_ptr<CWallet>& pwallet : GetWallets()) {
|
||||||
WalletDatabase& dbh = pwallet->GetDBHandle();
|
WalletDatabase& dbh = pwallet->GetDBHandle();
|
||||||
|
|
Loading…
Reference in a new issue