Module chainmonitor
Expand description
Logic to connect off-chain channel management with on-chain transaction monitoring.
ChainMonitor is an implementation of chain::Watch used both to process blocks and to
update ChannelMonitors accordingly. If any on-chain events need further processing, it will
make those available as MonitorEvents to be consumed.
ChainMonitor is parameterized by an optional chain source, which must implement the
chain::Filter trait. This provides a mechanism to signal new relevant outputs back to light
clients, such that transactions spending those outputs are included in block data.
ChainMonitor may be used directly to monitor channels locally or as a part of a distributed
setup to monitor channels remotely. In the latter case, a custom chain::Watch implementation
would be responsible for routing each update to a remote server and for retrieving monitor
events. The remote server would make use of ChainMonitor for block processing and for
servicing ChannelMonitor updates from the client.
Structs§
- Chain
Monitor - An implementation of
chain::Watchfor monitoring channels. - Locked
Channel Monitor - A read-only reference to a current ChannelMonitor.
- Monitor
Update Id - An opaque identifier describing a specific
Persistmethod call.
Traits§
- Persist
Persistdefines behavior for persisting channel monitors: this could mean writing once to disk, and/or uploading to one or more backup services.