File tree Expand file tree Collapse file tree 2 files changed +12
-19
lines changed Expand file tree Collapse file tree 2 files changed +12
-19
lines changed Original file line number Diff line number Diff line change @@ -433,11 +433,6 @@ void CWalletDBWrapper::IncrementUpdateCounter()
433
433
++nUpdateCounter;
434
434
}
435
435
436
- unsigned int CWalletDBWrapper::GetUpdateCounter ()
437
- {
438
- return nUpdateCounter.load ();
439
- }
440
-
441
436
void CDB::Close ()
442
437
{
443
438
if (!pdb)
Original file line number Diff line number Diff line change @@ -797,24 +797,22 @@ void MaybeCompactWalletDB()
797
797
return ;
798
798
}
799
799
800
- /* TODO: fix me
801
- CWalletDBWrapper& dbh = pwalletMain ->GetDBHandle();
800
+ for (CWalletRef pwallet : vpwallets) {
801
+ CWalletDBWrapper& dbh = pwallet ->GetDBHandle ();
802
802
803
- static unsigned int nLastSeen = dbh.GetUpdateCounter();
804
- static unsigned int nLastFlushed = dbh.GetUpdateCounter();
805
- static int64_t nLastWalletUpdate = GetTime();
806
-
807
- if (nLastSeen != dbh.GetUpdateCounter()) {
808
- nLastSeen = dbh.GetUpdateCounter();
809
- nLastWalletUpdate = GetTime();
810
- }
803
+ unsigned int nUpdateCounter = dbh.nUpdateCounter ;
804
+ if (dbh.nLastSeen != nUpdateCounter) {
805
+ dbh.nLastSeen = nUpdateCounter;
806
+ dbh.nLastWalletUpdate = GetTime ();
807
+ }
811
808
812
- if (nLastFlushed != dbh.GetUpdateCounter() && GetTime() - nLastWalletUpdate >= 2) {
813
- if (CDB::PeriodicFlush(dbh)) {
814
- nLastFlushed = dbh.GetUpdateCounter();
809
+ if (dbh.nLastFlushed != nUpdateCounter && GetTime () - dbh.nLastWalletUpdate >= 2 ) {
810
+ if (CDB::PeriodicFlush (dbh)) {
811
+ dbh.nLastFlushed = nUpdateCounter;
812
+ }
815
813
}
816
814
}
817
- */
815
+
818
816
fOneThread = false ;
819
817
}
820
818
You can’t perform that action at this time.
0 commit comments