BlockTip struct created and connected to notifyHeaderTip and notifyBlockTip signals.

This commit is contained in:
furszy
2020-01-23 21:34:58 -03:00
parent 2f867203b0
commit a06e845e82
4 changed files with 22 additions and 14 deletions

View File

@@ -315,7 +315,7 @@ public:
std::unique_ptr<Handler> handleNotifyBlockTip(NotifyBlockTipFn fn) override
{
return MakeHandler(::uiInterface.NotifyBlockTip_connect([fn](SynchronizationState sync_state, const CBlockIndex* block) {
fn(sync_state, block->GetBlockHash(), block->nHeight, block->GetBlockTime(),
fn(sync_state, BlockTip{block->nHeight, block->GetBlockTime(), block->GetBlockHash()},
GuessVerificationProgress(Params().TxData(), block));
}));
}
@@ -323,7 +323,7 @@ public:
{
return MakeHandler(
::uiInterface.NotifyHeaderTip_connect([fn](SynchronizationState sync_state, const CBlockIndex* block) {
fn(sync_state, block->GetBlockHash(), block->nHeight, block->GetBlockTime(),
fn(sync_state, BlockTip{block->nHeight, block->GetBlockTime(), block->GetBlockHash()},
/* verification progress is unused when a header was received */ 0);
}));
}