-
Notifications
You must be signed in to change notification settings - Fork 411
Add PeerManager::disconnect_node_id() #783
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
Add PeerManager::disconnect_node_id() #783
Conversation
Codecov Report
@@ Coverage Diff @@
## main #783 +/- ##
========================================
Coverage 91.23% 91.23%
========================================
Files 37 37
Lines 22623 22921 +298
========================================
+ Hits 20639 20911 +272
- Misses 1984 2010 +26
Continue to review full report at Codecov.
|
c6c6aef
to
070ec49
Compare
Updated at 070ec49 |
lightning/src/ln/peer_handler.rs
Outdated
/// Set no_connection_possible to true to prevent any further connection with this peer, | ||
/// force-closing any channels we have with it. | ||
/// | ||
/// Beware with reentrancy issues about disconnect_socket! |
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.
Can we state that "if a peer is connected, this will call disconnect_socket
on the descriptor for the peer, so be careful about reentrancy issues" - there's no reason to not provide more detail on exactly what will happen.
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.
Updated with comment.
This public method allows a client to easily disconnect peers while only owning its node id. It will clean up peer state and disconnect properly its descriptor.
070ec49
to
5b7d7ed
Compare
This is trivial. Going to merge. |
This public method allows a client to easily disconnect peers while only
owning its node id. It will clean up peer state and disconnect properly
its descriptor.
Motivation: http://gnusha.org/rust-bitcoin/2021-01-28.log
Required to implement
disconnect
cmd on the sample-side, we might rework our PeerManager API andlightning-net-tokio
once we agree on a good interface.