-
Notifications
You must be signed in to change notification settings - Fork 117
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.
Motivation
We want to return outbound and inbound peer addresses in the
getpeerinfo
response. We currently return only outbound connections as these are the only ones we have access to by the address book.Solution
AddressBookType
to theAddressBook
structure so we can have 2 books, one for each type without interfering one with the other.There are several ways to do this, i decided for upgrading the current address book structure with the addition of the type because there are multiple fields in the zcashd response that are available in the address book structure we might need to add in the future.
Tests
A basic unit tests was extended to check the inbound address book case. Existing tests were modified to have the outbound type so everything keeps passing. More tests can be created.
PR Author's Checklist
PR Reviewer's Checklist