-
Notifications
You must be signed in to change notification settings - Fork 403
Fail create_channel
early if peer is disconnected
#2437
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
Comments
Bonus points if we instead address #2096 (ie don't fail but rebroadcast the open_channel message on reconnect, failing in a minute or two from a timeout instead). |
@dunxen i can try this one |
Great, thanks! Matt’s bonus points would be good to handle from his comment above alternatively :) |
To ensure robustness, I propose adding a check for peer disconnection within this function. Currently, we only verify if we know about the peer through the per_peer_state. However, it is crucial to also consider the peer's connection status by using .is_connected. This enhancement will enable us to fail early when attempting to invoke ChannelManager::create_channel for a disconnected peer. Here's the proposed code modification: // Existing code // Proposed modification By implementing this check, we can proactively address issues related to disconnected peers when using ChannelManager::create_channel. |
Hi! I couldn't help but notice the PR has been open for a little while. I've given it a shot at solving the issue. I would absolutely love to hear your thoughts on what I've come up with. Thanks a bunch! :) |
Oh, oops, dup of #2096. |
We need to ensure in the case where a peer is disconnected that we fail early when we invoke
ChannelManager::create_channel
fortheir_network_key
.The only thing we currently do is check if we know about the peer at all (they're in the
per_peer_state
):rust-lightning/lightning/src/ln/channelmanager.rs
Line 2195 in e4c44f3
We also need to check for
.is_connected
if we know about the peer.See #2382 (comment)
The text was updated successfully, but these errors were encountered: