pub trait Listen {
    fn block_connected(&self, block: &Block, height: u32);
    fn block_disconnected(&self, header: &BlockHeader, height: u32);
}
Expand description

The Listen trait is used to notify when blocks have been connected or disconnected from the chain.

Useful when needing to replay chain data upon startup or as new chain events occur. Clients sourcing chain data using a block-oriented API should prefer this interface over Confirm. Such clients fetch the entire header chain whereas clients using Confirm only fetch headers when needed.

Required methods

Notifies the listener that a block was added at the given height.

Notifies the listener that a block was removed at the given height.

Implementations on Foreign Types

Implementors