Browse Source

Rename FlushWalletDB -> CompactWalletDB, add function description

0.15
Matt Corallo 8 years ago
parent
commit
0235be1e7a
  1. 2
      src/wallet/wallet.cpp
  2. 2
      src/wallet/walletdb.cpp
  3. 3
      src/wallet/walletdb.h

2
src/wallet/wallet.cpp

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

2
src/wallet/walletdb.cpp

@ -777,7 +777,7 @@ DBErrors CWalletDB::ZapWalletTx(vector<CWalletTx>& vWtx) @@ -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)) {

3
src/wallet/walletdb.h

@ -193,6 +193,7 @@ private: @@ -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

Loading…
Cancel
Save