Struct lightning_block_sync::poll::ChainPoller [−][src]
pub struct ChainPoller<B: DerefMut<Target = T> + Sized, T: BlockSource> { /* fields omitted */ }
Expand description
The canonical Poll
implementation used for a single BlockSource
.
Other Poll
implementations should be built using ChainPoller
as it provides the simplest way
of validating chain data and checking consistency.
Implementations
Trait Implementations
fn poll_chain_tip<'a>(
&'a mut self,
best_known_chain_tip: ValidatedBlockHeader
) -> AsyncBlockSourceResult<'a, ChainTip>
fn poll_chain_tip<'a>(
&'a mut self,
best_known_chain_tip: ValidatedBlockHeader
) -> AsyncBlockSourceResult<'a, ChainTip>
Returns a chain tip in terms of its relationship to the provided chain tip.
fn look_up_previous_header<'a>(
&'a mut self,
header: &'a ValidatedBlockHeader
) -> AsyncBlockSourceResult<'a, ValidatedBlockHeader>
fn look_up_previous_header<'a>(
&'a mut self,
header: &'a ValidatedBlockHeader
) -> AsyncBlockSourceResult<'a, ValidatedBlockHeader>
Returns the header that preceded the given header in the chain.
fn fetch_block<'a>(
&'a mut self,
header: &'a ValidatedBlockHeader
) -> AsyncBlockSourceResult<'a, ValidatedBlock>
fn fetch_block<'a>(
&'a mut self,
header: &'a ValidatedBlockHeader
) -> AsyncBlockSourceResult<'a, ValidatedBlock>
Returns the block associated with the given header.