File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -2478,12 +2478,12 @@ bool Chainstate::FlushStateToDisk(
2478
2478
}
2479
2479
}
2480
2480
}
2481
- const auto nNow = GetTime<std::chrono::microseconds>() ;
2481
+ const auto nNow{ SteadyClock::now ()} ;
2482
2482
// Avoid writing/flushing immediately after startup.
2483
- if (m_last_write. count () == 0 ) {
2483
+ if (m_last_write == decltype (m_last_write){} ) {
2484
2484
m_last_write = nNow;
2485
2485
}
2486
- if (m_last_flush. count () == 0 ) {
2486
+ if (m_last_flush == decltype (m_last_flush){} ) {
2487
2487
m_last_flush = nNow;
2488
2488
}
2489
2489
// The cache is large and we're within 10% and 10 MiB of the limit, but we have time now (not in the middle of a block processing).
@@ -2544,7 +2544,7 @@ bool Chainstate::FlushStateToDisk(
2544
2544
m_last_flush = nNow;
2545
2545
full_flush_completed = true ;
2546
2546
TRACE5 (utxocache, flush,
2547
- ( int64_t )( GetTimeMicros () - nNow. count ()), // in microseconds (µs)
2547
+ int64_t {Ticks<std::chrono::microseconds>( SteadyClock::now () - nNow)},
2548
2548
(uint32_t )mode,
2549
2549
(uint64_t )coins_count,
2550
2550
(uint64_t )coins_mem_usage,
Original file line number Diff line number Diff line change @@ -785,8 +785,8 @@ class Chainstate
785
785
void UpdateTip (const CBlockIndex* pindexNew)
786
786
EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
787
787
788
- std::chrono::microseconds m_last_write{0 };
789
- std::chrono::microseconds m_last_flush{0 };
788
+ SteadyClock::time_point m_last_write{};
789
+ SteadyClock::time_point m_last_flush{};
790
790
791
791
friend ChainstateManager;
792
792
};
You can’t perform that action at this time.
0 commit comments