Struct lightning::chain::chainmonitor::ChainMonitor[][src]

pub struct ChainMonitor<ChannelSigner: Sign, C: Deref, T: Deref, F: Deref, L: Deref, P: Deref> where
    C::Target: Filter,
    T::Target: BroadcasterInterface,
    F::Target: FeeEstimator,
    L::Target: Logger,
    P::Target: Persist<ChannelSigner>, 
{ pub monitors: RwLock<HashMap<OutPoint, ChannelMonitor<ChannelSigner>>>, // some fields omitted }
Expand description

An implementation of chain::Watch for monitoring channels.

Connected and disconnected blocks must be provided to ChainMonitor as documented by chain::Watch. May be used in conjunction with ChannelManager to monitor channels locally or used independently to monitor channels remotely. See the module-level documentation for details.

Fields

monitors: RwLock<HashMap<OutPoint, ChannelMonitor<ChannelSigner>>>

The monitors

Implementations

Creates a new ChainMonitor used to watch on-chain activity pertaining to channels.

When an optional chain source implementing chain::Filter is provided, the chain monitor will call back to it indicating transactions and outputs of interest. This allows clients to pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may always need to fetch full blocks absent another means for determining which blocks contain transactions relevant to the watched channels.

Trait Implementations

Processes transactions confirmed in a block with a given header and height. Read more

Processes a transaction that is no longer confirmed as result of a chain reorganization. Read more

Processes an update to the best header connected at the given height. Read more

Returns transactions that should be monitored for reorganization out of the chain. Read more

Processes SpendableOutputs events produced from each ChannelMonitor upon maturity.

An EventHandler may safely call back to the provider, though this shouldn’t be needed in order to handle these events.

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

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

Adds the monitor that watches the channel referred to by the given outpoint.

Calls back to chain::Filter with the funding transaction and outputs to watch.

Note that we persist the given ChannelMonitor while holding the ChainMonitor monitors lock.

Note that we persist the given ChannelMonitor update while holding the ChainMonitor monitors lock.

Returns any monitor events since the last call. Subsequent calls must only return new events. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.