Trait breez_sdk_liquid::lightning::chain::Listen

pub trait Listen {
    // Required methods
    fn filtered_block_connected(
        &self,
        header: &BlockHeader,
        txdata: &[(usize, &Transaction)],
        height: u32,
    );
    fn block_disconnected(&self, header: &BlockHeader, height: u32);

    // Provided method
    fn block_connected(&self, block: &Block, 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.

By using Listen::filtered_block_connected this interface supports clients fetching the entire header chain and only blocks with matching transaction data using BIP 157 filters or other similar filtering.

Required Methods§

fn filtered_block_connected( &self, header: &BlockHeader, txdata: &[(usize, &Transaction)], height: u32, )

Notifies the listener that a block was added at the given height, with the transaction data possibly filtered.

fn block_disconnected(&self, header: &BlockHeader, height: u32)

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

Provided Methods§

fn block_connected(&self, block: &Block, height: u32)

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

Implementations on Foreign Types§

§

impl<Signer, T, F, L> Listen for (ChannelMonitor<Signer>, T, F, L)

§

fn filtered_block_connected( &self, header: &BlockHeader, txdata: &[(usize, &Transaction)], height: u32, )

§

fn block_disconnected(&self, header: &BlockHeader, height: u32)

§

impl<T> Listen for dyn Deref<Target = T>
where T: Listen,

§

fn filtered_block_connected( &self, header: &BlockHeader, txdata: &[(usize, &Transaction)], height: u32, )

§

fn block_disconnected(&self, header: &BlockHeader, height: u32)

§

impl<T, U> Listen for (T, U)
where T: Deref, U: Deref, <T as Deref>::Target: Listen, <U as Deref>::Target: Listen,

§

fn filtered_block_connected( &self, header: &BlockHeader, txdata: &[(usize, &Transaction)], height: u32, )

§

fn block_disconnected(&self, header: &BlockHeader, height: u32)

Implementors§

§

impl<ChannelSigner, C, T, F, L, P> Listen for ChainMonitor<ChannelSigner, C, T, F, L, P>
where ChannelSigner: WriteableEcdsaChannelSigner, C: Deref, T: Deref, F: Deref, L: Deref, P: Deref, <C as Deref>::Target: Filter, <T as Deref>::Target: BroadcasterInterface, <F as Deref>::Target: FeeEstimator, <L as Deref>::Target: Logger, <P as Deref>::Target: Persist<ChannelSigner>,

§

impl<M, T, ES, NS, SP, F, R, L> Listen for ChannelManager<M, T, ES, NS, SP, F, R, L>
where M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref, F: Deref, R: Deref, L: Deref, <M as Deref>::Target: Watch<<<SP as Deref>::Target as SignerProvider>::Signer>, <T as Deref>::Target: BroadcasterInterface, <ES as Deref>::Target: EntropySource, <NS as Deref>::Target: NodeSigner, <SP as Deref>::Target: SignerProvider, <F as Deref>::Target: FeeEstimator, <R as Deref>::Target: Router, <L as Deref>::Target: Logger,