zebra_state::service::write

Function update_latest_chain_channels

source
fn update_latest_chain_channels(
    non_finalized_state: &NonFinalizedState,
    chain_tip_sender: &mut ChainTipSender,
    non_finalized_state_sender: &Sender<NonFinalizedState>,
    last_zebra_mined_log_height: &mut Option<Height>,
) -> Height
Expand description

Update the LatestChainTip, ChainTipChange, and non_finalized_state_sender channels with the latest non-finalized ChainTipBlock and Chain.

last_zebra_mined_log_height is used to rate-limit logging.

Returns the latest non-finalized chain tip height.

ยงPanics

If the non_finalized_state is empty.