-
Notifications
You must be signed in to change notification settings - Fork 725
[Net] Turn net structures into dumb storage classes #1646
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
[Net] Turn net structures into dumb storage classes #1646
Conversation
f4fea01 to
5a67de0
Compare
|
rebased now that #1640 has been merged |
furszy
left a comment
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.
Code first impression ACK, overall is looking nice.
src/masternode.cpp
Outdated
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.
Would be good to pass the service by reference
random-zebra
left a comment
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.
Code ACK, looking pretty good. Couple irrelevant styling nits that can be safely ignored (or addressed later, maybe with a script).
Will give it some testing.
43089a9 to
a3c6a44
Compare
This command serves no real purpose, offers no checking that the address entered is even a MN (which it shouldn't), and is essentially just a stripped down version of the addnode command.
The checking of the port in masternode.conf files was overly complex. This simplifies it whilst maintaining that the port much match the default P2P port for the current network and removes the reliance on "magic numbers".
This also adds some sanity checking to masternode startup arguments: * -listen can't be 0 when -masternode is 1 * when -masternode is set, require that the client uses the default port * validate the port supplied (if any) for -masternodeaddr Lastly, `CMasternodeBroadcast::CheckDefaultPort` now takes a `CService` as it's first argument instead of a string.
Net functionality is no longer needed for CAddress/CAddrman/etc. now that CNetAddr/CService/CSubNet are dumb storage classes.
Also fix up a few small issues: - Lookup with "badip:port" now sets the port to 0 - Don't allow assert to have side-effects
apply clang-format
a3c6a44 to
b36f743
Compare
furszy
left a comment
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.
tested ACK b36f743
random-zebra
left a comment
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.
ACK b36f743 and merging...
Backport of bitcoin#8128 as part of #1374. Based on top of #1640
Original Description:
Additional work has been done in the following commits: