From 376086fc5a187f5b2ab3a0d1202ed4e6c22bdb50 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 13 Aug 2022 14:21:12 -0400 Subject: Make validation interface capable of signalling header presync This makes a number of changes: - Get rid of the verification_progress argument in the node interface NotifyHeaderTip (it was always 0.0). - Instead of passing a CBlockIndex* in the UI interface's NotifyHeaderTip, send separate height, timestamp fields. This is becuase in headers presync, no actual CBlockIndex object is available. - Add a bool presync argument to both of the above, to identify signals pertaining to the first headers sync phase. --- src/qt/clientmodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/qt') diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index f41da519df..927554eaaf 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -267,8 +267,8 @@ void ClientModel::subscribeToCoreSignals() TipChanged(sync_state, tip, verification_progress, /*header=*/false); }); m_handler_notify_header_tip = m_node.handleNotifyHeaderTip( - [this](SynchronizationState sync_state, interfaces::BlockTip tip, double verification_progress) { - TipChanged(sync_state, tip, verification_progress, /*header=*/true); + [this](SynchronizationState sync_state, interfaces::BlockTip tip, bool presync) { + if (!presync) TipChanged(sync_state, tip, /*verification_progress=*/0.0, /*header=*/true); }); } -- cgit v1.2.3