@ -3765,7 +3765,7 @@ void CWallet::postInitProcess(CScheduler& scheduler)
// Run a thread to flush wallet periodically
if (!CWallet::fFlushScheduled.exchange(true)) {
scheduler.scheduleEvery(MaybeFlushWalletDB, 500);
scheduler.scheduleEvery(MaybeCompactWalletDB, 500);
}
@ -777,7 +777,7 @@ DBErrors CWalletDB::ZapWalletTx(vector<CWalletTx>& vWtx)
return DB_LOAD_OK;
void MaybeFlushWalletDB()
void MaybeCompactWalletDB()
{
static std::atomic<bool> fOneThread;
if (fOneThread.exchange(true)) {
@ -193,6 +193,7 @@ private:
void operator=(const CWalletDB&);
};
void MaybeFlushWalletDB();
//! Compacts BDB state so that wallet.dat is self-contained (if there are changes)
void MaybeCompactWalletDB();
#endif // BITCOIN_WALLET_WALLETDB_H