Skip to main content

update_latest_chain_channels

Function update_latest_chain_channels 

Source
fn update_latest_chain_channels(
    non_finalized_state: &NonFinalizedState,
    finalized_state: &ZebraDb,
    chain_tip_sender: &mut ChainTipSender,
    non_finalized_state_sender: &Sender<NonFinalizedState>,
    backup_dir_path: Option<&Path>,
) -> Option<Height>
Expand description

Update the LatestChainTip, ChainTipChange, and non_finalized_state_sender channels with the latest state. If there is no non-finalized chain, use the finalized tip.

If backup_dir_path is Some, the non-finalized state is written to the backup directory before updating the channels.

Returns the latest chain tip height, or None if both states are empty.