-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix potential peer_state deadlocks in finish_force_close_channel
#2597
Fix potential peer_state deadlocks in finish_force_close_channel
#2597
Conversation
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #2597 +/- ##
=======================================
Coverage 88.85% 88.86%
=======================================
Files 113 113
Lines 84482 84517 +35
Branches 84482 84517 +35
=======================================
+ Hits 75069 75103 +34
+ Misses 7213 7211 -2
- Partials 2200 2203 +3
☔ View full report in Codecov by Sentry. |
Feel free to squash |
`ChannelManager::finish_force_close_channel` exists to do cleanups which must happen without the `per_peer_state` mutex held. However, because it lacked lock assertions, several changes snuck in recently which resulted in it running with peer-state locks held, risking a deadlock if some HTLCs need to be failed.
We have code to handle receiving `shutdown` messages on unfudned channels. However, it had no test coverage, which we add here.
913a330
to
20e1c27
Compare
Squashed. |
// P2WSH | ||
let script = Builder::new().push_int(0) | ||
.push_slice(&[0; 20]) | ||
.into_script(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: P2WPKH*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦 Will fix in #2591
ChannelManager::finish_force_close_channel
exists to do cleanups which must happen without theper_peer_state
mutex held. However, because it lacked lock assertions, several changes snuck in recently which resulted in it running with peer-state locks held, risking a deadlock if some HTLCs need to be failed.