Waits for the connected tip to change until timeout has elapsed. During node initialization, this will wait until the tip is connected (regardless of timeout). Returns the current tip, or nullopt if the node is shutting down or interrupt() is called.

Synopsis

Declared in <node/miner.h>

std::optional<interfaces::BlockRef>
WaitTipChanged(
    ChainstateManager& chainman,
    KernelNotifications& kernel_notifications,
    uint256 const& current_tip,
    MillisecondsDouble& timeout,
    bool& interrupt);

Return Value

The new tip reference, or std::nullopt if shutting down or interrupted.

Parameters

Name

Description

chainman

The chainstate manager to query.

kernel_notifications

The notifications object used to wait for tip changes.

current_tip

The tip hash to wait for a change from.

timeout

Maximum time to wait; updated with the remaining time.

interrupt

Flag that, when set, ends the wait early.

Created with MrDocs