Fix re-sending commitment updates with an outbound fee update
authorMatt Corallo <git@bluematt.me>
Wed, 30 Jun 2021 18:12:51 +0000 (18:12 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 13 Aug 2021 21:54:50 +0000 (21:54 +0000)
commit9d49c5c1a174bf807ed04421f0f08578b569448c
treee60c2c4f5e2ef2f68b0254b0e75d6595cfc8fc11
parentb09a60b7b554834e43f72e60059b21fdbafef3f1
Fix re-sending commitment updates with an outbound fee update

When we send an update_fee to our counterparty on an outbound
channel, if we need to re-send a commitment update after
reconnection, the update_fee must be present in the re-sent
commitment update messages. However, wewere always setting the
update_fee field in the commitment update to None, causing us to
generate invalid commitment signatures and get channel
force-closures.

This fixes the issue by correctly detecting when an update_fee
needs to be re-sent, doing so when required.
lightning/src/ln/chanmon_update_fail_tests.rs
lightning/src/ln/channel.rs