Skip to content

Commit 85e18f0

Browse files
TheBlueMattfurszy
authored andcommitted
Rename FlushWalletDB -> CompactWalletDB, add function description
1 parent 00f36ea commit 85e18f0

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
@@ -4138,7 +4138,7 @@ void CWallet::postInitProcess(CScheduler& scheduler)
41384138

41394139
// Run a thread to flush wallet periodically
41404140
if (!CWallet::fFlushScheduled.exchange(true)) {
4141-
scheduler.scheduleEvery(MaybeFlushWalletDB, 500);
4141+
scheduler.scheduleEvery(MaybeCompactWalletDB, 500);
41424142
}
41434143
}
41444144

src/wallet/walletdb.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,7 @@ DBErrors CWalletDB::ZapWalletTx(CWallet* pwallet, std::vector<CWalletTx>& vWtx)
891891
return DB_LOAD_OK;
892892
}
893893

894-
void MaybeFlushWalletDB()
894+
void MaybeCompactWalletDB()
895895
{
896896
static std::atomic<bool> fOneThread;
897897
if (fOneThread.exchange(true)) {

src/wallet/walletdb.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ void NotifyBacked(const CWallet& wallet, bool fSuccess, std::string strMessage);
230230
bool BackupWallet(const CWallet& wallet, const fs::path& strDest);
231231
bool AttemptBackupWallet(const CWallet& wallet, const fs::path& pathSrc, const fs::path& pathDest);
232232

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

235236
#endif // BITCOIN_WALLETDB_H

0 commit comments

Comments
 (0)