Set notifications m_tip_block in LoadChainTip()

Ensure KernelNotifications m_tip_block is set even if no new block arrives.

Additionally, have node init always wait for this to happen.
This commit is contained in:
Sjors Provoost
2024-12-06 14:24:21 +07:00
parent 2eccb8bc5e
commit 37946c0aaf
5 changed files with 26 additions and 8 deletions

View File

@@ -4721,6 +4721,13 @@ bool Chainstate::LoadChainTip()
m_chain.Height(),
FormatISO8601DateTime(tip->GetBlockTime()),
GuessVerificationProgress(m_chainman.GetParams().TxData(), tip));
// Ensure KernelNotifications m_tip_block is set even if no new block arrives.
if (this->GetRole() != ChainstateRole::BACKGROUND) {
// Ignoring return value for now.
(void)m_chainman.GetNotifications().blockTip(GetSynchronizationState(/*init=*/true, m_chainman.m_blockman.m_blockfiles_indexed), *pindex);
}
return true;
}