File tree Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -614,14 +614,12 @@ void BerkeleyEnvironment::Flush(bool fShutdown)
614
614
}
615
615
}
616
616
617
- bool BerkeleyBatch ::PeriodicFlush (BerkeleyDatabase& database )
617
+ bool BerkeleyDatabase ::PeriodicFlush ()
618
618
{
619
- if (database. IsDummy ()) {
619
+ if (IsDummy ()) {
620
620
return true ;
621
621
}
622
622
bool ret = false ;
623
- BerkeleyEnvironment *env = database.env .get ();
624
- const std::string& strFile = database.strFile ;
625
623
TRY_LOCK (cs_db, lockDb);
626
624
if (lockDb)
627
625
{
Original file line number Diff line number Diff line change @@ -131,6 +131,9 @@ class BerkeleyDatabase
131
131
/* * Make sure all changes are flushed to disk.
132
132
*/
133
133
void Flush (bool shutdown);
134
+ /* flush the wallet passively (TRY_LOCK)
135
+ ideal to be called periodically */
136
+ bool PeriodicFlush ();
134
137
135
138
void IncrementUpdateCounter ();
136
139
@@ -215,10 +218,6 @@ class BerkeleyBatch
215
218
void Flush ();
216
219
void Close ();
217
220
218
- /* flush the wallet passively (TRY_LOCK)
219
- ideal to be called periodically */
220
- static bool PeriodicFlush (BerkeleyDatabase& database);
221
-
222
221
template <typename K, typename T>
223
222
bool Read (const K& key, T& value)
224
223
{
Original file line number Diff line number Diff line change @@ -964,7 +964,7 @@ void MaybeCompactWalletDB()
964
964
}
965
965
966
966
if (dbh.nLastFlushed != nUpdateCounter && GetTime () - dbh.nLastWalletUpdate >= 2 ) {
967
- if (BerkeleyBatch:: PeriodicFlush (dbh )) {
967
+ if (dbh. PeriodicFlush ()) {
968
968
dbh.nLastFlushed = nUpdateCounter;
969
969
}
970
970
}
You can’t perform that action at this time.
0 commit comments