Skip to content

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants