[][src]Struct lightning::ln::channelmonitor::SimpleManyChannelMonitor

pub struct SimpleManyChannelMonitor<Key> { /* fields omitted */ }

A simple implementation of a ManyChannelMonitor and ChainListener. Can be used to create a watchtower or watch our own channels.

Note that you must provide your own key by which to refer to channels.

If you're accepting remote monitors (ie are implementing a watchtower), you must verify that users cannot overwrite a given channel by providing a duplicate key. ie you should probably index by a PublicKey which is required to sign any updates.

If you're using this for local monitoring of your own channels, you probably want to use OutPoint as the key, which will give you a ManyChannelMonitor implementation.

Methods

impl<Key: Send + Eq + Hash + 'static> SimpleManyChannelMonitor<Key>[src]

pub fn new(
    chain_monitor: Arc<dyn ChainWatchInterface>,
    broadcaster: Arc<dyn BroadcasterInterface>,
    logger: Arc<dyn Logger>,
    feeest: Arc<dyn FeeEstimator>
) -> Arc<SimpleManyChannelMonitor<Key>>
[src]

Creates a new object which can be used to monitor several channels given the chain interface with which to register to receive notifications.

pub fn add_update_monitor_by_key(
    &self,
    key: Key,
    monitor: ChannelMonitor
) -> Result<(), MonitorUpdateError>
[src]

Adds or updates the monitor which monitors the channel referred to by the given key.

Trait Implementations

impl<'a, Key: Send + Eq + Hash> ChainListener for SimpleManyChannelMonitor<Key>[src]

impl<Key: Send + Eq + Hash> EventsProvider for SimpleManyChannelMonitor<Key>[src]

impl ManyChannelMonitor for SimpleManyChannelMonitor<OutPoint>[src]

Auto Trait Implementations

impl<Key> !RefUnwindSafe for SimpleManyChannelMonitor<Key>

impl<Key> Send for SimpleManyChannelMonitor<Key> where
    Key: Send

impl<Key> Sync for SimpleManyChannelMonitor<Key> where
    Key: Send

impl<Key> Unpin for SimpleManyChannelMonitor<Key> where
    Key: Unpin

impl<Key> !UnwindSafe for SimpleManyChannelMonitor<Key>

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.