Changeset View
Changeset View
Standalone View
Standalone View
src/protocol.cpp
Show All 37 Lines | |||||
const char *FILTERADD = "filteradd"; | const char *FILTERADD = "filteradd"; | ||||
const char *FILTERCLEAR = "filterclear"; | const char *FILTERCLEAR = "filterclear"; | ||||
const char *SENDHEADERS = "sendheaders"; | const char *SENDHEADERS = "sendheaders"; | ||||
const char *FEEFILTER = "feefilter"; | const char *FEEFILTER = "feefilter"; | ||||
const char *SENDCMPCT = "sendcmpct"; | const char *SENDCMPCT = "sendcmpct"; | ||||
const char *CMPCTBLOCK = "cmpctblock"; | const char *CMPCTBLOCK = "cmpctblock"; | ||||
const char *GETBLOCKTXN = "getblocktxn"; | const char *GETBLOCKTXN = "getblocktxn"; | ||||
const char *BLOCKTXN = "blocktxn"; | const char *BLOCKTXN = "blocktxn"; | ||||
const char *GETCFHEADERS = "getcfheaders"; | |||||
const char *CFHEADERS = "cfheaders"; | |||||
const char *GETCFCHECKPT = "getcfcheckpt"; | const char *GETCFCHECKPT = "getcfcheckpt"; | ||||
const char *CFCHECKPT = "cfcheckpt"; | const char *CFCHECKPT = "cfcheckpt"; | ||||
const char *AVAPOLL = "avapoll"; | const char *AVAPOLL = "avapoll"; | ||||
const char *AVARESPONSE = "avaresponse"; | const char *AVARESPONSE = "avaresponse"; | ||||
bool IsBlockLike(const std::string &strCommand) { | bool IsBlockLike(const std::string &strCommand) { | ||||
return strCommand == NetMsgType::BLOCK || | return strCommand == NetMsgType::BLOCK || | ||||
strCommand == NetMsgType::CMPCTBLOCK || | strCommand == NetMsgType::CMPCTBLOCK || | ||||
strCommand == NetMsgType::BLOCKTXN; | strCommand == NetMsgType::BLOCKTXN; | ||||
} | } | ||||
}; // namespace NetMsgType | }; // namespace NetMsgType | ||||
/** | /** | ||||
* All known message types. Keep this in the same order as the list of messages | * All known message types. Keep this in the same order as the list of messages | ||||
* above and in protocol.h. | * above and in protocol.h. | ||||
*/ | */ | ||||
static const std::string allNetMessageTypes[] = { | static const std::string allNetMessageTypes[] = { | ||||
NetMsgType::VERSION, NetMsgType::VERACK, NetMsgType::ADDR, | NetMsgType::VERSION, NetMsgType::VERACK, NetMsgType::ADDR, | ||||
NetMsgType::INV, NetMsgType::GETDATA, NetMsgType::MERKLEBLOCK, | NetMsgType::INV, NetMsgType::GETDATA, NetMsgType::MERKLEBLOCK, | ||||
NetMsgType::GETBLOCKS, NetMsgType::GETHEADERS, NetMsgType::TX, | NetMsgType::GETBLOCKS, NetMsgType::GETHEADERS, NetMsgType::TX, | ||||
NetMsgType::HEADERS, NetMsgType::BLOCK, NetMsgType::GETADDR, | NetMsgType::HEADERS, NetMsgType::BLOCK, NetMsgType::GETADDR, | ||||
NetMsgType::MEMPOOL, NetMsgType::PING, NetMsgType::PONG, | NetMsgType::MEMPOOL, NetMsgType::PING, NetMsgType::PONG, | ||||
NetMsgType::NOTFOUND, NetMsgType::FILTERLOAD, NetMsgType::FILTERADD, | NetMsgType::NOTFOUND, NetMsgType::FILTERLOAD, NetMsgType::FILTERADD, | ||||
NetMsgType::FILTERCLEAR, NetMsgType::SENDHEADERS, NetMsgType::FEEFILTER, | NetMsgType::FILTERCLEAR, NetMsgType::SENDHEADERS, NetMsgType::FEEFILTER, | ||||
NetMsgType::SENDCMPCT, NetMsgType::CMPCTBLOCK, NetMsgType::GETBLOCKTXN, | NetMsgType::SENDCMPCT, NetMsgType::CMPCTBLOCK, NetMsgType::GETBLOCKTXN, | ||||
NetMsgType::BLOCKTXN, NetMsgType::GETCFCHECKPT, NetMsgType::CFCHECKPT, | NetMsgType::BLOCKTXN, NetMsgType::GETCFHEADERS, NetMsgType::CFHEADERS, | ||||
NetMsgType::GETCFCHECKPT, NetMsgType::CFCHECKPT, | |||||
}; | }; | ||||
static const std::vector<std::string> | static const std::vector<std::string> | ||||
allNetMessageTypesVec(allNetMessageTypes, | allNetMessageTypesVec(allNetMessageTypes, | ||||
allNetMessageTypes + ARRAYLEN(allNetMessageTypes)); | allNetMessageTypes + ARRAYLEN(allNetMessageTypes)); | ||||
CMessageHeader::CMessageHeader(const MessageMagic &pchMessageStartIn) { | CMessageHeader::CMessageHeader(const MessageMagic &pchMessageStartIn) { | ||||
memcpy(std::begin(pchMessageStart), std::begin(pchMessageStartIn), | memcpy(std::begin(pchMessageStart), std::begin(pchMessageStartIn), | ||||
MESSAGE_START_SIZE); | MESSAGE_START_SIZE); | ||||
▲ Show 20 Lines • Show All 171 Lines • Show Last 20 Lines |