Permalink
Browse files

net: Add and document network messages in protocol.h

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

Github-Pull: #7181
Rebased-From: 9bbe71b
  • Loading branch information...
laanwj committed Dec 7, 2015
1 parent 44fef99 commit 8fc174aae64882d43549ad57bece0c23805e567b
Showing with 281 additions and 63 deletions.
  1. +1 −1 src/alert.cpp
  2. +57 −57 src/main.cpp
  3. +1 −1 src/net.cpp
  4. +63 −4 src/protocol.cpp
  5. +159 −0 src/protocol.h
View
@@ -138,7 +138,7 @@ bool CAlert::RelayTo(CNode* pnode) const
AppliesToMe() ||
GetAdjustedTime() < nRelayUntil)
{
pnode->PushMessage("alert", *this);
pnode->PushMessage(NetMsgType::ALERT, *this);
return true;
}
}
Oops, something went wrong.

0 comments on commit 8fc174a

Please sign in to comment.