/// Try to find all orphan chain tips that originate from the current orphan parent block.
Try to find all orphan chain tips that originate from the current orphan parent block.
Try to find all orphan chain tips that originate from the current orphan parent block .
fn find_orphan_chain_tips<T: BlockchainBackend>(db: &T, parent_height: u64, parent_hash: BlockHash) -> Vec<BlockHash> {
    let mut count = 0;
    let mut orphans = Vec::<(BlockHash, BlockHash, u64)>::new();
    let start = std::time::Instant::now();
    // we cache all data in the orphan pool, so we only have to step through once.
    db.for_each_orphan(|pair| {
        count += 1;
        let (_, block) = pair.unwrap();
        orphans.push((block.hash(), block.header.prev_hash, block.header.height));
    })
    .expect("Unexpected result for database query");
    debug!(
        target: LOG_TARGET,
        "Searched {} orphan(s) in {:.0?}",
        count,
        start.elapsed()
    );
    // Now lets call the actual search for tips from the cached data
    find_orphan_chain_tips_recursive(&orphans, db, parent_height, parent_hash)
}
fn find_orphan_chain_tips < T : BlockchainBackend > ( db : & T , parent_height : u64 , parent_hash : BlockHash ) -> Vec < BlockHash > { let mut count = 0 ; let mut orphans = Vec :: < ( BlockHash , BlockHash , u64 ) > :: new ( ) ; let start = std :: time :: Instant :: now ( ) ; // we cache all data in the orphan pool, so we only have to step through once. db . for_each_orphan ( | pair | { count += 1 ; let ( _ , block ) = pair . unwrap ( ) ; orphans . push ( ( block . hash ( ) , block . header . prev_hash , block . header . height ) ) ; } ) . expect ( " " ) ; debug ! ( target LOG_TARGET " " count start elapsed ( ) ) ; // Now lets call the actual search for tips from the cached data find_orphan_chain_tips_recursive ( & orphans , db , parent_height , parent_hash ) }
Try to find all orphan chain tips that originate from the current orphan parent block.
Try to find all orphan chain tips that originate from the current orphan parent block .
db
&T
parent_height
u64
parent_hash
BlockHash