]> git.bitcoin.ninja Git - rust-lightning/commit
Wait to free the holding cell during channel_reestablish handling
authorMatt Corallo <git@bluematt.me>
Thu, 17 Nov 2022 05:48:21 +0000 (05:48 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 17 Nov 2022 17:57:17 +0000 (17:57 +0000)
commit7e9b88a5cd008c34221bc3eb5084511bd894cc3d
tree3639c36c3103e11d01b5bac81e166a330b434905
parentc8c0997862d9afa0cd6fe637ca5872e126eea21f
Wait to free the holding cell during channel_reestablish handling

When we process a `channel_reestablish` message we free the HTLC
update holding cell as things may have changed while we were
disconnected. However, some time ago, to handle freeing from the
holding cell when a monitor update completes, we added a holding
cell freeing check in `get_and_clear_pending_msg_events`. This
leaves the in-`channel_reestablish` holding cell clear redundant,
as doing it immediately or is `get_and_clear_pending_msg_events` is
not a user-visible difference.

Thus, we remove the redundant code here, substantially simplifying
`handle_chan_restoration_locked` while we're at it.
lightning/src/ln/chanmon_update_fail_tests.rs
lightning/src/ln/channel.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/functional_test_utils.rs
lightning/src/ln/reload_tests.rs