mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
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.
This commit is contained in:
committed by
Suhas Daftuar
parent
93eae27031
commit
376086fc5a
@@ -377,9 +377,8 @@ public:
|
||||
std::unique_ptr<Handler> handleNotifyHeaderTip(NotifyHeaderTipFn fn) override
|
||||
{
|
||||
return MakeHandler(
|
||||
::uiInterface.NotifyHeaderTip_connect([fn](SynchronizationState sync_state, const CBlockIndex* block) {
|
||||
fn(sync_state, BlockTip{block->nHeight, block->GetBlockTime(), block->GetBlockHash()},
|
||||
/* verification progress is unused when a header was received */ 0);
|
||||
::uiInterface.NotifyHeaderTip_connect([fn](SynchronizationState sync_state, int64_t height, int64_t timestamp, bool presync) {
|
||||
fn(sync_state, BlockTip{(int)height, timestamp, uint256{}}, presync);
|
||||
}));
|
||||
}
|
||||
NodeContext* context() override { return m_context; }
|
||||
|
||||
Reference in New Issue
Block a user