mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-24 06:57:53 +01:00
When a `ChannelMonitor` sees a payment preimage on chain for an outbound HTLC, it creates a `MonitorEvent` containing the preimage to pass to the inbound edge. The inclusion of the transaction containing the payment preimage (plus six confirmations) also results in the corresponding `Balance` being removed from the live balance set, allowing the `ChannelMonitor` to be pruned (after a further 4032 blocks). While `MonitorEvent`s should always be processed in a timely manner, if a node is suffering from a bug where they are not, its possible for 4038 blocks to pass with the preimage-containing `MonitorEvent` still pending. If that happens, its possible the `ChannelMonitor` is archived even though the preimage in it is needed in another channel (or `ChannelMonitor`), causing funds loss. Luckily the fix is simple - check for pending events before allowing a `ChannelMonitor` to be archived. Fixes #2153 |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |