Skip to content
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

Merged
merged 3 commits into from
May 8, 2020

Conversation

Fuzzbawls
Copy link
Collaborator

Ported from bitcoin#7181 with layer 2 messages in a followup commit, then ran both commits through clang-format-diff.py

  • 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.

laanwj and others added 3 commits April 18, 2020 23:23
- 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.
@Fuzzbawls Fuzzbawls added this to the Future milestone Apr 20, 2020
@Fuzzbawls Fuzzbawls self-assigned this Apr 20, 2020
@Fuzzbawls Fuzzbawls added this to In progress in Update network code from upstream via automation Apr 20, 2020
@random-zebra random-zebra modified the milestones: Future, 5.0.0 Apr 24, 2020
Copy link

@random-zebra random-zebra left a 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

Copy link

@furszy furszy left a 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();
Copy link

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.

Update network code from upstream automation moved this from In progress to Reviewer approved May 4, 2020
@furszy furszy merged commit 87fefac into PIVX-Project:master May 8, 2020
Update network code from upstream automation moved this from Reviewer approved to Done May 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants