pub struct ChannelMonitor { /* fields omitted */ }
A ChannelMonitor handles chain events (blocks connected and disconnected) and generates
on-chain transactions to ensure no loss of funds occurs.
You MUST ensure that no ChannelMonitors for a given channel anywhere contain out-of-date
information and are actively monitoring the chain.
Combines this ChannelMonitor with the information contained in the other ChannelMonitor.
After a successful call this ChannelMonitor is up-to-date and is safe to use to monitor the
chain for new blocks/transactions.
Gets the funding transaction outpoint of the channel this ChannelMonitor is monitoring for.
Gets the sets of all outpoints which this ChannelMonitor expects to hear about spends of.
Generally useful when deserializing as during normal operation the return values of
block_connected are sufficient to ensure all relevant outpoints are being monitored (note
that the get_funding_txo outpoint and transaction must also be monitored for!).
Writes this monitor into the given writer, suitable for writing to disk.
Note that the deserializer is only implemented for (Sha256dHash, ChannelMonitor), which
tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
the "reorg path" (ie not just starting at the same height but starting at the highest
common block that appears on your best chain as well as on the chain which contains the
last block hash returned) upon deserializing the object!
Encodes this monitor into the given writer, suitable for sending to a remote watchtower
Note that the deserializer is only implemented for (Sha256dHash, ChannelMonitor), which
tells you the last block hash which was block_connect()ed. You MUST rescan any blocks along
the "reorg path" (ie not just starting at the same height but starting at the highest
common block that appears on your best chain as well as on the chain which contains the
last block hash returned) upon deserializing the object!
Performs copy-assignment from source
. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static