/// Initialize and return a new ConsensusCache with data from the given
/// ConsensusPool.
Initialize and return a new ConsensusCache with data from the given
ConsensusPool.
Initialize and return a new ConsensusCache with data from the given ConsensusPool .
pub(crate) fn new(pool: &dyn ConsensusPool) -> Self {
        let catch_up_package = get_highest_catch_up_package(pool);
        let finalized_block = get_highest_finalized_block(pool, &catch_up_package.cup);
        let mut summary_block = catch_up_package.cup.content.block.as_ref().clone();
        update_summary_block(pool, &mut summary_block, &finalized_block);
        Self {
            cache: RwLock::new(CachedData {
                finalized_block,
                summary_block,
                catch_up_package,
            }),
        }
    }
pub ( crate ) fn new ( pool : & dyn ConsensusPool ) -> Self { let catch_up_package = get_highest_catch_up_package ( pool ) ; let finalized_block = get_highest_finalized_block ( pool , & catch_up_package . cup ) ; let mut summary_block = catch_up_package . cup . content . block . as_ref ( ) . clone ( ) ; update_summary_block ( pool , & mut summary_block , & finalized_block ) ; Self { cache : RwLock :: new ( CachedData { finalized_block , summary_block , catch_up_package , } ) , } }
Initialize and return a new ConsensusCache with data from the given
ConsensusPool.
Initialize and return a new ConsensusCache with data from the given ConsensusPool .
pool
&dyn ConsensusPool