Use correct to_remote script in counterparty commitments
authorWilmer Paulino <wilmer@wilmerpaulino.com>
Mon, 25 Sep 2023 23:53:42 +0000 (16:53 -0700)
committerWilmer Paulino <wilmer@wilmerpaulino.com>
Fri, 29 Sep 2023 20:46:56 +0000 (13:46 -0700)
commit33b745f54e7d3ed7b34c40f27e9b2945f50b5d87
tree311688356a49c28c522826391338baa8c0b02cd3
parent6016101ac8ff31275f31f68eef8d33e94b19c0b1
Use correct to_remote script in counterparty commitments

While our commitment transactions did use the correct `to_remote`
script, the `ChannelMonitor`'s was not as it is tracked separately. This
would lead to users never receiving an `Event::SpendableOutputs` with a
`StaticPaymentOutput` descriptor to claim the funds.

Luckily, any users affected which had channel closures confirmed by a
counterparty commitment just need to replay the closing transaction to
receive the event.
lightning/src/chain/channelmonitor.rs
lightning/src/ln/chan_utils.rs
lightning/src/ln/monitor_tests.rs