Skip to main content

find_split_point

Function find_split_point 

Source
pub fn find_split_point(
    db: &BlockchainDatabase,
    block_ids: &[BlockHash],
    chronological_order: bool,
    include_alt_blocks: bool,
    tx_ro: &Snapshot,
) -> DbResult<usize>
Expand description

Find the split point between our chain and a list of BlockHashs from another chain.

This function accepts chains in chronological and reverse chronological order, however if the wrong order is specified the return value is meaningless.

For chronologically ordered chains this will return the index of the first unknown, for reverse chronologically ordered chains this will return the index of the first known.

If all blocks are known for chronologically ordered chains or unknown for reverse chronologically ordered chains then the length of the block_ids will be returned.