-
Notifications
You must be signed in to change notification settings - Fork 410
Expose peer addresses in PeerManager
#2019
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
Expose peer addresses in PeerManager
#2019
Conversation
Maybe let's just include this in the list peers method? That way users don't have to call twice and correlate (and handle races where you have inconsistent data) |
b92b51f
to
cec565a
Compare
Codecov ReportBase: 91.06% // Head: 91.04% // Decreases project coverage by
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #2019 +/- ##
==========================================
- Coverage 91.06% 91.04% -0.03%
==========================================
Files 99 99
Lines 51724 51724
Branches 51724 51724
==========================================
- Hits 47105 47093 -12
- Misses 4619 4631 +12
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
I assume you're referring to |
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.
Feel free to squash.
cec565a
to
4ce6474
Compare
Merged both methods into |
4ce6474
to
c275f72
Compare
Needs rebase, sorry. |
c275f72
to
903dc8d
Compare
Rebased. |
Looks good to me. Do you think perhaps this might benefit from tests? |
903dc8d
to
2e8f73e
Compare
Now included a note mentioning that the > git diff-tree -U2 903dc8df 2e8f73e5
diff --git a/lightning/src/ln/peer_handler.rs b/lightning/src/ln/peer_handler.rs
index 19e5bdbe..4577e4a8 100644
--- a/lightning/src/ln/peer_handler.rs
+++ b/lightning/src/ln/peer_handler.rs
@@ -742,4 +742,7 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, OM: Deref, L: Deref, CM
/// handshake has completed and we are sure the remote peer has the private key for the given
/// [`PublicKey`].
+ ///
+ /// The returned `Option`s will only be `Some` if an address had been previously given via
+ /// [`Self::new_outbound_connection`] or [`Self::new_inbound_connection`].
pub fn get_peer_node_ids(&self) -> Vec<(PublicKey, Option<NetAddress>)> {
let peers = self.peers.read().unwrap(); |
Now checking the given |
Closes #2018
In this PR we expose the
NetAddresses
of connected peers inPeerManager
.