Skip to main content

find_fork_point

Function find_fork_point 

Source
pub fn find_fork_point<C>(
    chain: Option<C>,
    db: &ZebraDb,
    known_blocks: Vec<Hash>,
) -> Option<(Height, Hash)>
where C: AsRef<Chain>,
Expand description

Finds the fork point between the locator known_blocks and the best chain.

known_blocks is a block locator: hashes ordered from highest height to lowest height. Returns the height and hash of the highest locator entry that is on the best chain (in chain or the finalized db) — the most recent common ancestor — or None if no locator entry is on the best chain.

Returns None if the state is empty.