]> git.bitcoin.ninja Git - rust-lightning/commit
Avoid early return upon confirmation of channel funding
authorWilmer Paulino <wilmer@wilmerpaulino.com>
Fri, 22 Sep 2023 17:39:10 +0000 (10:39 -0700)
committerWilmer Paulino <wilmer@wilmerpaulino.com>
Fri, 29 Sep 2023 18:46:25 +0000 (11:46 -0700)
commit92fcdd39e18bd2a5662ab2ef17738d805fd7df35
treec972f4625805bfc826f0ea750ee522d1ed8c91d5
parent6016101ac8ff31275f31f68eef8d33e94b19c0b1
Avoid early return upon confirmation of channel funding

This early return is only possible if the channel requires a single
confirmation, allowing a `channel_ready` message to go out. This can be
problematic though if a commitment transaction (specifically from the
counterparty, as the channel would be immediately closed if a local
commitment is broadcast) also confirms within the same block. The
`ChannelMonitor` will detect both, but it won't inform the
`ChannelManager` at all. Luckily, while the channel still is considered
open to the `ChannelManager`, the `ChannelMonitor` will reject any
further updates to the channel state.
lightning/src/ln/channel.rs
lightning/src/ln/functional_tests.rs