Type Definition lightning_block_sync::UnboundedCache
source · [−]pub type UnboundedCache = HashMap<BlockHash, ValidatedBlockHeader>;
Expand description
Unbounded cache of block headers keyed by block hash.
Trait Implementations
sourceimpl Cache for UnboundedCache
impl Cache for UnboundedCache
sourcefn look_up(&self, block_hash: &BlockHash) -> Option<&ValidatedBlockHeader>
fn look_up(&self, block_hash: &BlockHash) -> Option<&ValidatedBlockHeader>
Retrieves the block header keyed by the given block hash.
sourcefn block_connected(
&mut self,
block_hash: BlockHash,
block_header: ValidatedBlockHeader
)
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. Read more
sourcefn block_disconnected(
&mut self,
block_hash: &BlockHash
) -> Option<ValidatedBlockHeader>
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. Read more