[][src]Struct lightning::chain::chaininterface::BlockNotifier

pub struct BlockNotifier<'a> { /* fields omitted */ }

Utility for notifying listeners about new blocks, and handling block rescans if new watch data is registered.

Methods

impl<'a> BlockNotifier<'a>[src]

pub fn new(chain_monitor: Arc<dyn ChainWatchInterface>) -> BlockNotifier<'a>[src]

Constructs a new BlockNotifier without any listeners.

pub fn register_listener(&self, listener: Weak<dyn ChainListener + 'a>)[src]

Register the given listener to receive events. Only a weak pointer is provided and the registration should be freed once that pointer expires.

pub fn block_connected<'b>(&self, block: &'b Block, height: u32)[src]

Notify listeners that a block was connected given a full, unfiltered block.

Handles re-scanning the block and calling block_connected again if listeners register new watch data during the callbacks for you (see ChainListener::block_connected for more info).

pub fn block_connected_checked(
    &self,
    header: &BlockHeader,
    height: u32,
    txn_matched: &[&Transaction],
    indexes_of_txn_matched: &[u32]
) -> bool
[src]

Notify listeners that a block was connected, given pre-filtered list of transactions in the block which matched the filter (probably using does_match_tx).

Returns true if notified listeners registered additional watch data (implying that the block must be re-scanned and this function called again prior to further block_connected calls, see ChainListener::block_connected for more info).

pub fn block_disconnected(&self, header: &BlockHeader, disconnected_height: u32)[src]

Notify listeners that a block was disconnected.

Auto Trait Implementations

impl<'a> !RefUnwindSafe for BlockNotifier<'a>

impl<'a> Send for BlockNotifier<'a>

impl<'a> Sync for BlockNotifier<'a>

impl<'a> Unpin for BlockNotifier<'a>

impl<'a> !UnwindSafe for BlockNotifier<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.