Uh oh!
There was an error while loading. Please reload this page.
Wait to free the holding cell during channel_reestablish handling - #1859
Conversation
Asserting that specific log entries were printed isn't all that useful, we should really be focusing on the expected messages (or, when a monitor udpate fails, the lack thereof). In the next commit one of these log checks would otherwise break due to the particular time a monitor update fails changing, but I also plan on reworking the montior update flows substantially soon, breaking lots of them.
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.
There is no reason anymore for `handle_chan_restoration_locked` to be a macro, and our long-term desire is to move away from macros as they substantially bloat our compilation time (and binary size). Thus, we simply remove `handle_chan_restoration_locked` here and turn it into a function.
755f15c to
f1c6cd8CompareCodecov ReportBase: 90.61% // Head: 90.70% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@## main #1859 +/- ##
==========================================
+ Coverage 90.61% 90.70% +0.09%
==========================================
Files 90 90 Lines 47623 47552 -71 Branches 47623 47552 -71 ==========================================
- Hits 43152 43132 -20 + Misses 4471 4420 -51
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
valentinewallace
left a comment
There was a problem hiding this comment.
Otherwise LGTM I think
Uh oh!
There was an error while loading. Please reload this page.
Now that `handle_channel_resumption` can't fail, the error handling in `post_handle_chan_restoration` is now dead code. Removing it makes `post_handle_chan_restoration` only a single block, so here we simply remove the macro and inline the single block into the two places the macro was used.

When we process a
channel_reestablishmessage we free the HTLCupdate 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. Thisleaves the in-
channel_reestablishholding cell clear redundant,as doing it immediately or is
get_and_clear_pending_msg_eventsisnot a user-visible difference.
Thus, we remove the redundant code here, substantially simplifying
handle_chan_restoration_lockedwhile we're at it.