]> git.bitcoin.ninja Git - rust-lightning/commit
Queue BackgroundEvent to force close channels upon ChannelManager::read
authorWilmer Paulino <wilmer@wilmerpaulino.com>
Tue, 28 Feb 2023 18:45:48 +0000 (10:45 -0800)
committerWilmer Paulino <wilmer@wilmerpaulino.com>
Tue, 21 Mar 2023 23:25:46 +0000 (16:25 -0700)
commitbd4eb0da76207a68396de8b36fb640467255cc31
tree7c301b407632e5e94dc86b465d9492984083e628
parent5a90f014f283f20e783c5db32ffb63c019a8dbe6
Queue BackgroundEvent to force close channels upon ChannelManager::read

This results in a new, potentially redundant, `ChannelMonitorUpdate`
that must be applied to `ChannelMonitor`s to broadcast the holder's
latest commitment transaction.

This is a behavior change for anchor channels since their commitments
may require additional fees to be attached through a child anchor
transaction. Recall that anchor transactions are only generated by the
event consumer after processing a `BumpTransactionEvent::ChannelClose`
event, which is yielded after applying a
`ChannelMonitorUpdateStep::ChannelForceClosed` monitor update. Assuming
the node operator is not watching the mempool to generate these anchor
transactions without LDK, an anchor channel which we had to fail when
deserializing our `ChannelManager` would have its commitment transaction
broadcast by itself, potentially exposing the node operator to loss of
funds if the commitment transaction's fee is not enough to be accepted
into the network's mempools.
lightning/src/chain/channelmonitor.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/monitor_tests.rs
lightning/src/ln/payment_tests.rs
lightning/src/ln/reload_tests.rs
lightning/src/ln/reorg_tests.rs