[−][src]Struct lightning::chain::chaininterface::BlockNotifier
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]
&self,
header: &BlockHeader,
height: u32,
txn_matched: &[&Transaction],
indexes_of_txn_matched: &[u32]
) -> bool
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,