+//! Adapters that make one or more [`BlockSource`]s simpler to poll for new chain tip transitions.
+
use crate::{AsyncBlockSourceResult, BlockHeaderData, BlockSource, BlockSourceError, BlockSourceResult};
use bitcoin::blockdata::block::Block;
/// A block header with validated proof of work and corresponding block hash.
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct ValidatedBlockHeader {
- block_hash: BlockHash,
+ pub(crate) block_hash: BlockHash,
inner: BlockHeaderData,
}
/// A block with validated data against its transaction list and corresponding block hash.
pub struct ValidatedBlock {
- block_hash: BlockHash,
+ pub(crate) block_hash: BlockHash,
inner: Block,
}
///
/// Other `Poll` implementations must be built using `ChainPoller` as it provides the only means of
/// validating chain data.
-pub struct ChainPoller<B: DerefMut<Target=T> + Sized + Sync + Send, T: BlockSource> {
+pub struct ChainPoller<B: DerefMut<Target=T> + Sized , T: BlockSource> {
block_source: B,
network: Network,
}
-impl<B: DerefMut<Target=T> + Sized + Sync + Send, T: BlockSource> ChainPoller<B, T> {
+impl<B: DerefMut<Target=T> + Sized , T: BlockSource> ChainPoller<B, T> {
/// Creates a new poller for the given block source.
///
/// If the `network` parameter is mainnet, then the difficulty between blocks is checked for
}
}
-impl<B: DerefMut<Target=T> + Sized + Sync + Send, T: BlockSource> Poll for ChainPoller<B, T> {
+impl<B: DerefMut<Target=T> + Sized + Send + Sync, T: BlockSource> Poll for ChainPoller<B, T> {
fn poll_chain_tip<'a>(&'a mut self, best_known_chain_tip: ValidatedBlockHeader) ->
AsyncBlockSourceResult<'a, ChainTip>
{