Skip to content

Remove invalid debug_asserts in peer_connected/peer_disconnected #3919

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

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions lightning/src/ln/channelmanager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11917,7 +11917,12 @@ where
debug_assert!(peer_state.is_connected, "A disconnected peer cannot disconnect");
peer_state.is_connected = false;
peer_state.ok_to_remove(true)
} else { debug_assert!(false, "Unconnected peer disconnected"); true }
} else {
// Note that the peer might already be marked as disconnected as we might have
// called this function already via a different callpath (i.e., other
// implementation of `BaseMessageHandler`.
false
}
};
if remove_peer {
per_peer_state.remove(&counterparty_node_id);
Expand Down Expand Up @@ -11981,7 +11986,9 @@ where
return NotifyOption::SkipPersistNoEvents;
}

debug_assert!(!peer_state.is_connected, "A peer shouldn't be connected twice");
// Note that the peer might already be marked as connected as we might have
// called this function already via a different callpath (i.e., other
// implementation of `BaseMessageHandler`.
peer_state.is_connected = true;
},
}
Expand Down
Loading