14 #include <arpa/inet.h>
24 const char*
INV =
"inv";
29 const char*
TX =
"tx";
76 const static std::string allNetMessageTypes[] = {
135 const static std::vector<std::string> allNetMessageTypesVec(allNetMessageTypes, allNetMessageTypes +
ARRAYLEN(allNetMessageTypes));
136 const static std::vector<std::string> tiertwoNetMessageTypesVec(std::find(allNetMessageTypesVec.begin(), allNetMessageTypesVec.end(),
NetMsgType::SPORK), allNetMessageTypesVec.end());
153 assert(pszCommand[i] == 0);
178 }
else if (*p1 < ' ' || *p1 > 0x7E)
184 LogPrintf(
"CMessageHeader::IsValid() : (%s, %u bytes) nMessageSize > MAX_SIZE\n",
GetCommand(),
nMessageSize);
231 case MSG_DSTX:
return cmd.append(
"dstx");
240 throw std::out_of_range(
strprintf(
"%s: type=%d unknown type", __func__,
type));
252 return allNetMessageTypesVec;
257 return tiertwoNetMessageTypesVec;
std::string ToString() const
std::string GetCommand() const
bool IsMasterNodeType() const
std::string ToString() const
void * memcpy(void *a, const void *b, size_t c)
Bitcoin protocol message types.
const char * QFCOMMITMENT
The qfcommit message is used to propagate LLMQ final commitments.
const char * MNBROADCAST2
The mnbroadcast2 message is used to broadcast masternode startup data to connected peers Supporting B...
const char * BUDGETVOTESYNC
The budgetvotesync message is used to request budget vote data from connected peers.
const char * FILTERLOAD
The filterload message tells the receiving peer to filter all relayed transactions and requested merk...
const char * MNWINNER
The mnwinner message is used to relay and distribute consensus for masternode payout ordering.
const char * BLOCK
The block message transmits a single serialized block.
const char * FILTERCLEAR
The filterclear message tells the receiving peer to remove a previously-set bloom filter.
const char * HEADERS
The headers message sends one or more block headers to a node which previously requested certain head...
const char * GETMNLIST
The dseg message is used to request the Masternode list or an specific entry.
const char * ADDRV2
The addrv2 message relays connection information for peers on the network just like the addr message,...
const char * SENDHEADERS
Indicates that a node prefers to receive new block announcements via a "headers" message rather than ...
const char * PONG
The pong message replies to a ping message, proving to the pinging node that the ponging node is stil...
const char * GETMNWINNERS
The getmnwinners message is used to request winning masternode data from connected peers.
const char * QSENDRECSIGS
The qsendrecsigs message is used to propagate LLMQ intra-quorum partial recovered signatures.
const char * QGETSIGSHARES
const char * GETADDR
The getaddr message requests an addr message from the receiving node, preferably one with lots of IP ...
const char * FINALBUDGETVOTE
The finalbudgetvote message is used to broadcast or relay finalized budget votes to connected peers.
const char * NOTFOUND
The notfound message is a reply to a getdata message which requested an object the receiving node doe...
const char * MEMPOOL
The mempool message requests the TXIDs of transactions that the receiving node has verified as valid ...
const char * TX
The tx message transmits a single transaction.
const char * FILTERADD
The filteradd message tells the receiving peer to add a single element to a previously-set bloom filt...
const char * QPCOMMITMENT
const char * ADDR
The addr (IP address) message relays connection information for peers on the network.
const char * VERSION
The version message provides information about the transmitting node to the receiving node at the beg...
const char * GETBLOCKS
The getblocks message requests an inv message that provides block header hashes starting from a parti...
const char * MNBROADCAST
The mnbroadcast message is used to broadcast masternode startup data to connected peers.
const char * FINALBUDGET
The finalbudget message is used to broadcast or relay finalized budget metadata to connected peers.
const char * GETHEADERS
The getheaders message requests a headers message that provides block headers starting from a particu...
const char * GETDATA
The getdata message requests one or more data objects from another node.
const char * MNPING
The mnping message is used to ensure a masternode is still active.
const char * QJUSTIFICATION
const char * BUDGETVOTE
The budgetvote message is used to broadcast or relay budget proposal votes to connected peers.
const char * VERACK
The verack message acknowledges a previously-received version message, informing the connecting node ...
const char * SYNCSTATUSCOUNT
The syncstatuscount message is used to track the layer 2 syncing process.
const char * BUDGETPROPOSAL
The budgetproposal message is used to broadcast or relay budget proposal metadata to connected peers.
const char * ALERT
The alert message warns nodes of problems that may affect them or the rest of the network.
const char * SENDADDRV2
The sendaddrv2 message signals support for receiving ADDRV2 messages (BIP155).
const char * PING
The ping message is sent periodically to help confirm that the receiving peer is still connected.
const char * SPORK
The spork message is used to send spork values to connected peers.
const char * MERKLEBLOCK
The merkleblock message is a reply to a getdata message which requested a block using the inventory t...
const char * GETSPORKS
The getsporks message is used to request spork data from connected peers.
const char * QSIGSHARESINV
const char * MNAUTH
The mnauth message is used authenticate MN connections.
const char * INV
The inv message (inventory message) transmits one or more inventories of objects known to the transmi...
bool operator<(const CInv &a, const CInv &b)
const std::vector< std::string > & getAllNetMessageTypes()
const std::vector< std::string > & getTierTwoNetMessageTypes()
@ MSG_QUORUM_JUSTIFICATION
@ MSG_MASTERNODE_ANNOUNCE
@ MSG_MASTERNODE_SCANNING_ERROR
@ MSG_BUDGET_FINALIZED_VOTE
@ MSG_QUORUM_PREMATURE_COMMITMENT
@ MSG_QUORUM_RECOVERED_SIG
@ MSG_QUORUM_FINAL_COMMITMENT
size_t strnlen(const char *start, size_t max_len)