pub type UnboundedCache = HashMap<BlockHash, ValidatedBlockHeader>;
Expand description

Unbounded cache of block headers keyed by block hash.

Aliased Type§

struct UnboundedCache { /* private fields */ }

Trait Implementations§

source§

impl Cache for UnboundedCache

source§

fn look_up(&self, block_hash: &BlockHash) -> Option<&ValidatedBlockHeader>

Retrieves the block header keyed by the given block hash.
source§

fn block_connected( &mut self, block_hash: BlockHash, block_header: ValidatedBlockHeader )

Called when a block has been connected to the best chain to ensure it is available to be disconnected later if needed.
source§

fn block_disconnected( &mut self, block_hash: &BlockHash ) -> Option<ValidatedBlockHeader>

Called when a block has been disconnected from the best chain. Once disconnected, a block’s header is no longer needed and thus can be removed.