Module lightning::chain::channelmonitor [−][src]
The logic to monitor for on-chain transactions and create the relevant claim responses lives here.
ChannelMonitor objects are generated by ChannelManager in response to relevant
messages/actions, and MUST be persisted to disk (and, preferably, remotely) before progress can
be made in responding to certain messages, see chain::Watch
for more.
Note that ChannelMonitors are an important part of the lightning trust model and a copy of the latest ChannelMonitor must always be actively monitoring for chain updates (and no out-of-date ChannelMonitors should do so). Thus, if you’re building rust-lightning into an HSM or other security-domain-separated system design, you should consider having multiple paths for ChannelMonitors to get out of the HSM and onto monitoring devices.
Structs
ChannelMonitor | A ChannelMonitor handles chain events (blocks connected and disconnected) and generates on-chain transactions to ensure no loss of funds occurs. |
ChannelMonitorUpdate | An update generated by the underlying Channel itself which contains some new information the ChannelMonitor should be made aware of. |
HTLCUpdate | Simple structure sent back by |
MonitorUpdateError | General Err type for ChannelMonitor actions. Generally, this implies that the data provided is inconsistent with the ChannelMonitor being called. eg for ChannelMonitor::update_monitor this means you tried to update a monitor for a different channel or the ChannelMonitorUpdate was corrupted. Contains a developer-readable error message. |
Enums
ChannelMonitorUpdateErr | An error enum representing a failure to persist a channel monitor update. |
MonitorEvent | An event to be processed by the ChannelManager. |
Constants
CLOSED_CHANNEL_UPDATE_ID | If:
(1) a channel has been force closed and
(2) we receive a preimage from a forward link that allows us to spend an HTLC output on
this channel’s (the backward link’s) broadcasted commitment transaction
then we allow the |
Traits
Persist |
|
Type Definitions
TransactionOutputs | Transaction outputs to watch for on-chain spends. |