-
Notifications
You must be signed in to change notification settings - Fork 719
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] Add and document network messages in protocol.h #1542
Conversation
- Avoids string typos (by making the compiler check) - Makes it easier to grep for handling/generation of a certain message type - Refer directly to documentation by following the symbol in IDE - Move list of valid message types to protocol.cpp: protocol.cpp is a more appropriate place for this, and having the array there makes it easier to keep things consistent.
This is being done as a separate commit so as to not trample on the initial cherry-picked commit.
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.
Very nice. utACK 26b1d9e
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.
Great PR, we need to continue cleaning stuff :) . We should definitely do the same over the walletdb
string constants.
Left a little improvement comment, could be tackled later.
ACK 26b1d9e
src/main.cpp
Outdated
sporkManager.ProcessSpork(pfrom, strCommand, vRecv); | ||
masternodeSync.ProcessMessage(pfrom, strCommand, vRecv); | ||
bool found = false; | ||
const std::vector<std::string> &allMessages = getAllNetMessageTypes(); |
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 is only used for the tier two messages check, would be good to call a getAllTierTwoMessageTypes
instead. Decreasing the amount of cycles of the loop that is below.
Ported from bitcoin#7181 with layer 2 messages in a followup commit, then ran both commits through
clang-format-diff.py