Skip to content

Commit 0235be1

Browse files
committed
Rename FlushWalletDB -> CompactWalletDB, add function description
1 parent 735d9b5 commit 0235be1

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/wallet/wallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3765,7 +3765,7 @@ void CWallet::postInitProcess(CScheduler& scheduler)
37653765

37663766
// Run a thread to flush wallet periodically
37673767
if (!CWallet::fFlushScheduled.exchange(true)) {
3768-
scheduler.scheduleEvery(MaybeFlushWalletDB, 500);
3768+
scheduler.scheduleEvery(MaybeCompactWalletDB, 500);
37693769
}
37703770
}
37713771

src/wallet/walletdb.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ DBErrors CWalletDB::ZapWalletTx(vector<CWalletTx>& vWtx)
777777
return DB_LOAD_OK;
778778
}
779779

780-
void MaybeFlushWalletDB()
780+
void MaybeCompactWalletDB()
781781
{
782782
static std::atomic<bool> fOneThread;
783783
if (fOneThread.exchange(true)) {

src/wallet/walletdb.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ class CWalletDB : public CDB
193193
void operator=(const CWalletDB&);
194194
};
195195

196-
void MaybeFlushWalletDB();
196+
//! Compacts BDB state so that wallet.dat is self-contained (if there are changes)
197+
void MaybeCompactWalletDB();
197198

198199
#endif // BITCOIN_WALLET_WALLETDB_H

0 commit comments

Comments
 (0)