-
Notifications
You must be signed in to change notification settings - Fork 120
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
rpc(getpeerinfo): Add inbound peers to method response #9214
base: main
Are you sure you want to change the base?
Conversation
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.
This looks like it should work, but it seems unnecessary to add another address book.
I made an alternative change in a9014f0 of #9201 if that looks acceptable.
Related: @mpguerra It would be nice to eventually refactor the address book into a service, it may be easier to do that ahead of adding fields to the getpeerinfo
response.
I don't think that is correct. For the |
I agree that adding a new method is not really needed so that was removed as part of d90e639 While it is almost true that In regards to calculating if the peer is live by the use of So, what i did in d90e639 for the Let me know how do you see it. Thanks! |
Motivation
We want to return outbound and inbound peer addresses in the
getpeerinfo
response. We currently return only outbound connections as these were the only ones we have access to by the address book. After #9201 was merged, we have inbound connections available in theMetaAddr
struct so we can use that to return peers of both connection types in the RPC response.Close #7893
Solution
is_inbound()
to know if a peer is inbound/outbound.currently_live_peers()
method to theAddressBookPeers
trait so we can return peers that are likely connected to us now instead of the ones that were responding before.Tests
Existing getpeerinfo tests were updated to reflect the change.
PR Author's Checklist
PR Reviewer's Checklist