Merge pull request #2172 from TheBlueMatt/2023-04-fix-panicy-debug-assert

Remove a race-y debug assertion in new channel update handling
This commit is contained in:
Matt Corallo 2023-04-14 15:00:12 +00:00 committed by GitHub
commit e1e38196e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1588,7 +1588,7 @@ macro_rules! handle_new_monitor_update {
($self: ident, $update_res: expr, $update_id: expr, $peer_state_lock: expr, $peer_state: expr, $per_peer_state_lock: expr, $chan: expr, MANUALLY_REMOVING, $remove: expr) => { { ($self: ident, $update_res: expr, $update_id: expr, $peer_state_lock: expr, $peer_state: expr, $per_peer_state_lock: expr, $chan: expr, MANUALLY_REMOVING, $remove: expr) => { {
// update_maps_on_chan_removal needs to be able to take id_to_peer, so make sure we can in // update_maps_on_chan_removal needs to be able to take id_to_peer, so make sure we can in
// any case so that it won't deadlock. // any case so that it won't deadlock.
debug_assert!($self.id_to_peer.try_lock().is_ok()); debug_assert_ne!($self.id_to_peer.held_by_thread(), LockHeldState::HeldByThread);
match $update_res { match $update_res {
ChannelMonitorUpdateStatus::InProgress => { ChannelMonitorUpdateStatus::InProgress => {
log_debug!($self.logger, "ChannelMonitor update for {} in flight, holding messages until the update completes.", log_debug!($self.logger, "ChannelMonitor update for {} in flight, holding messages until the update completes.",