pub struct BlockEvent<B> {
pub block: B,
pub checkpoint: CheckPoint,
}Expand description
A newly emitted block from Emitter.
Fields§
§block: BEither a full [Block] or [Header] of the new block.
checkpoint: CheckPointThe checkpoint of the new block.
A CheckPoint is a node of a linked list of BlockIds. This checkpoint is linked to
all BlockIds originally passed in Emitter::new as well as emitted blocks since then.
These blocks are guaranteed to be of the same chain.
This is important as BDK structures require block-to-apply to be connected with another block in the original chain.
Implementations§
Source§impl<B> BlockEvent<B>
impl<B> BlockEvent<B>
Sourcepub fn block_height(&self) -> u32
pub fn block_height(&self) -> u32
The block height of this new block.
Sourcepub fn block_hash(&self) -> BlockHash
pub fn block_hash(&self) -> BlockHash
The block hash of this new block.
Sourcepub fn connected_to(&self) -> BlockId
pub fn connected_to(&self) -> BlockId
The BlockId of a previous block that this block connects to.
This either returns a BlockId of a previously emitted block or from the chain we started
with (passed in as last_cp in Emitter::new).
This value is derived from BlockEvent::checkpoint.