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 }

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

impl<ChannelSigner: Sign, C: Deref, T: Deref, F: Deref, L: Deref, P: Deref> ChainMonitor<ChannelSigner, C, T, F, L, P> where
    C::Target: Filter,
    T::Target: BroadcasterInterface,
    F::Target: FeeEstimator,
    L::Target: Logger,
    P::Target: Persist<ChannelSigner>, 
[src]

pub fn new(
    chain_source: Option<C>,
    broadcaster: T,
    logger: L,
    feeest: F,
    persister: P
) -> Self
[src]

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

impl<ChannelSigner: Sign, C: Deref, T: Deref, F: Deref, L: Deref, P: Deref> Confirm for ChainMonitor<ChannelSigner, C, T, F, L, P> where
    C::Target: Filter,
    T::Target: BroadcasterInterface,
    F::Target: FeeEstimator,
    L::Target: Logger,
    P::Target: Persist<ChannelSigner>, 
[src]

impl<ChannelSigner: Sign, C: Deref, T: Deref, F: Deref, L: Deref, P: Deref> EventsProvider for ChainMonitor<ChannelSigner, C, T, F, L, P> where
    C::Target: Filter,
    T::Target: BroadcasterInterface,
    F::Target: FeeEstimator,
    L::Target: Logger,
    P::Target: Persist<ChannelSigner>, 
[src]

impl<ChannelSigner: Sign, C: Deref, T: Deref, F: Deref, L: Deref, P: Deref> Listen for ChainMonitor<ChannelSigner, C, T, F, L, P> where
    C::Target: Filter,
    T::Target: BroadcasterInterface,
    F::Target: FeeEstimator,
    L::Target: Logger,
    P::Target: Persist<ChannelSigner>, 
[src]

impl<ChannelSigner: Sign, C: Deref, T: Deref, F: Deref, L: Deref, P: Deref> Watch<ChannelSigner> for ChainMonitor<ChannelSigner, C, T, F, L, P> where
    C::Target: Filter,
    T::Target: BroadcasterInterface,
    F::Target: FeeEstimator,
    L::Target: Logger,
    P::Target: Persist<ChannelSigner>, 
[src]

fn watch_channel(
    &self,
    funding_outpoint: OutPoint,
    monitor: ChannelMonitor<ChannelSigner>
) -> Result<(), ChannelMonitorUpdateErr>
[src]

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.

fn update_channel(
    &self,
    funding_txo: OutPoint,
    update: ChannelMonitorUpdate
) -> Result<(), ChannelMonitorUpdateErr>
[src]

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

Auto Trait Implementations

impl<ChannelSigner, C, T, F, L, P> RefUnwindSafe for ChainMonitor<ChannelSigner, C, T, F, L, P> where
    C: RefUnwindSafe,
    F: RefUnwindSafe,
    L: RefUnwindSafe,
    P: RefUnwindSafe,
    T: RefUnwindSafe

impl<ChannelSigner, C, T, F, L, P> Send for ChainMonitor<ChannelSigner, C, T, F, L, P> where
    C: Send,
    ChannelSigner: Send,
    F: Send,
    L: Send,
    P: Send,
    T: Send

impl<ChannelSigner, C, T, F, L, P> Sync for ChainMonitor<ChannelSigner, C, T, F, L, P> where
    C: Sync,
    ChannelSigner: Send,
    F: Sync,
    L: Sync,
    P: Sync,
    T: Sync

impl<ChannelSigner, C, T, F, L, P> Unpin for ChainMonitor<ChannelSigner, C, T, F, L, P> where
    C: Unpin,
    ChannelSigner: Unpin,
    F: Unpin,
    L: Unpin,
    P: Unpin,
    T: Unpin

impl<ChannelSigner, C, T, F, L, P> UnwindSafe for ChainMonitor<ChannelSigner, C, T, F, L, P> where
    C: UnwindSafe,
    F: UnwindSafe,
    L: UnwindSafe,
    P: UnwindSafe,
    T: UnwindSafe

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 = Infallible

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.