diff options
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/clientmodel.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 837e5f4fed..b22f1bc35c 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -28,8 +28,8 @@ #include <QThread> #include <QTimer> -static int64_t nLastHeaderTipUpdateNotification = 0; -static int64_t nLastBlockTipUpdateNotification = 0; +static SteadyClock::time_point g_last_header_tip_update_notification{}; +static SteadyClock::time_point g_last_block_tip_update_notification{}; ClientModel::ClientModel(interfaces::Node& node, OptionsModel *_optionsModel, QObject *parent) : QObject(parent), @@ -222,9 +222,9 @@ void ClientModel::TipChanged(SynchronizationState sync_state, interfaces::BlockT // Throttle GUI notifications about (a) blocks during initial sync, and (b) both blocks and headers during reindex. const bool throttle = (sync_state != SynchronizationState::POST_INIT && synctype == SyncType::BLOCK_SYNC) || sync_state == SynchronizationState::INIT_REINDEX; - const int64_t now = throttle ? GetTimeMillis() : 0; - int64_t& nLastUpdateNotification = synctype != SyncType::BLOCK_SYNC ? nLastHeaderTipUpdateNotification : nLastBlockTipUpdateNotification; - if (throttle && now < nLastUpdateNotification + count_milliseconds(MODEL_UPDATE_DELAY)) { + const auto now{throttle ? SteadyClock::now() : SteadyClock::time_point{}}; + auto& nLastUpdateNotification = synctype != SyncType::BLOCK_SYNC ? g_last_header_tip_update_notification : g_last_block_tip_update_notification; + if (throttle && now < nLastUpdateNotification + MODEL_UPDATE_DELAY) { return; } |