Skip to content
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

Relax OnionMessenger::peer_disconnected assertion #2787

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

jkczyz
Copy link
Contributor

@jkczyz jkczyz commented Dec 12, 2023

When a peer is connected, OnionMessenger tracks it only if it supports onion messages. On disconnect, we debug_assert that the peer was in a state ConnectedPeer, failing when it is in the PendingConnection state. However, we were mistakenly asserting for peers that we were not tracking (i.e., that don't support onion messages). Relax the check to not fail on the latter.

Reported by @tnull

When a peer is connected, OnionMessenger tracks it only if it supports
onion messages. On disconnect, we debug_assert that the peer was in a
state ConnectedPeer, failing when it is in the PendingConnection state.
However, we were mistakenly asserting for peers that we were not
tracking (i.e., that don't support onion messages). Relax the check to
not fail on the latter.
@jkczyz jkczyz requested a review from tnull December 12, 2023 14:56
Copy link
Contributor

@tnull tnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Confirmed this fixes the test failure I was seeing.

@tnull tnull merged commit 2b04f19 into lightningdevkit:main Dec 12, 2023
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants