doc: Clarify waitTipChanged docs

It should be obvious that a wait is not needed if the tip does not
match.

Also, remove a comment that the blockTip notification was only meant for
the "UI". (It is used by other stuff for a long time)
This commit is contained in:
MarcoFalke 2024-09-25 09:59:05 +02:00
parent fc642c33ef
commit fa4c075033
No known key found for this signature in database
2 changed files with 1 additions and 3 deletions

View file

@ -64,8 +64,7 @@ public:
* Waits for the tip to change * Waits for the tip to change
* *
* @param[in] current_tip block hash of the current chain tip. Function waits * @param[in] current_tip block hash of the current chain tip. Function waits
* for the chain tip to change if this matches, otherwise * for the chain tip to differ from this.
* it returns right away.
* @param[in] timeout how long to wait for a new tip * @param[in] timeout how long to wait for a new tip
* @returns Hash and height of the current chain tip after this call. * @returns Hash and height of the current chain tip after this call.
*/ */

View file

@ -3533,7 +3533,6 @@ bool Chainstate::ActivateBestChain(BlockValidationState& state, std::shared_ptr<
m_chainman.m_options.signals->UpdatedBlockTip(pindexNewTip, pindexFork, still_in_ibd); m_chainman.m_options.signals->UpdatedBlockTip(pindexNewTip, pindexFork, still_in_ibd);
} }
// Always notify the UI if a new block tip was connected
if (kernel::IsInterrupted(m_chainman.GetNotifications().blockTip(GetSynchronizationState(still_in_ibd, m_chainman.m_blockman.m_blockfiles_indexed), *pindexNewTip))) { if (kernel::IsInterrupted(m_chainman.GetNotifications().blockTip(GetSynchronizationState(still_in_ibd, m_chainman.m_blockman.m_blockfiles_indexed), *pindexNewTip))) {
// Just breaking and returning success for now. This could // Just breaking and returning success for now. This could
// be changed to bubble up the kernel::Interrupted value to // be changed to bubble up the kernel::Interrupted value to