[−][src]Struct lightning::ln::channelmonitor::SimpleManyChannelMonitor
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]
chain_monitor: Arc<dyn ChainWatchInterface>,
broadcaster: Arc<dyn BroadcasterInterface>,
logger: Arc<dyn Logger>,
feeest: Arc<dyn FeeEstimator>
) -> Arc<SimpleManyChannelMonitor<Key>>
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]
&self,
key: Key,
monitor: ChannelMonitor
) -> Result<(), MonitorUpdateError>
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]
fn block_connected(
&self,
header: &BlockHeader,
height: u32,
txn_matched: &[&Transaction],
_indexes_of_txn_matched: &[u32]
)
[src]
&self,
header: &BlockHeader,
height: u32,
txn_matched: &[&Transaction],
_indexes_of_txn_matched: &[u32]
)
fn block_disconnected(&self, header: &BlockHeader, disconnected_height: u32)
[src]
impl<Key: Send + Eq + Hash> EventsProvider for SimpleManyChannelMonitor<Key>
[src]
fn get_and_clear_pending_events(&self) -> Vec<Event>
[src]
impl ManyChannelMonitor for SimpleManyChannelMonitor<OutPoint>
[src]
fn add_update_monitor(
&self,
funding_txo: OutPoint,
monitor: ChannelMonitor
) -> Result<(), ChannelMonitorUpdateErr>
[src]
&self,
funding_txo: OutPoint,
monitor: ChannelMonitor
) -> Result<(), ChannelMonitorUpdateErr>
fn fetch_pending_htlc_updated(&self) -> Vec<HTLCUpdate>
[src]
Auto Trait Implementations
impl<Key> !RefUnwindSafe for SimpleManyChannelMonitor<Key>
impl<Key> Send for SimpleManyChannelMonitor<Key> where
Key: Send,
Key: Send,
impl<Key> Sync for SimpleManyChannelMonitor<Key> where
Key: Send,
Key: Send,
impl<Key> Unpin for SimpleManyChannelMonitor<Key> where
Key: Unpin,
Key: Unpin,
impl<Key> !UnwindSafe for SimpleManyChannelMonitor<Key>
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>,