Changeset View
Changeset View
Standalone View
Standalone View
src/protocol.cpp
Show All 15 Lines | |||||
#include <atomic> | #include <atomic> | ||||
static std::atomic<bool> g_initial_block_download_completed(false); | static std::atomic<bool> g_initial_block_download_completed(false); | ||||
namespace NetMsgType { | namespace NetMsgType { | ||||
const char *VERSION = "version"; | const char *VERSION = "version"; | ||||
const char *VERACK = "verack"; | const char *VERACK = "verack"; | ||||
const char *ADDR = "addr"; | const char *ADDR = "addr"; | ||||
const char *ADDRV2 = "addrv2"; | |||||
const char *SENDADDRV2 = "sendaddrv2"; | |||||
const char *INV = "inv"; | const char *INV = "inv"; | ||||
const char *GETDATA = "getdata"; | const char *GETDATA = "getdata"; | ||||
const char *MERKLEBLOCK = "merkleblock"; | const char *MERKLEBLOCK = "merkleblock"; | ||||
const char *GETBLOCKS = "getblocks"; | const char *GETBLOCKS = "getblocks"; | ||||
const char *GETHEADERS = "getheaders"; | const char *GETHEADERS = "getheaders"; | ||||
const char *TX = "tx"; | const char *TX = "tx"; | ||||
const char *HEADERS = "headers"; | const char *HEADERS = "headers"; | ||||
const char *BLOCK = "block"; | const char *BLOCK = "block"; | ||||
Show All 28 Lines | |||||
} | } | ||||
}; // 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::ADDRV2, NetMsgType::SENDADDRV2, NetMsgType::INV, | ||||
NetMsgType::GETBLOCKS, NetMsgType::GETHEADERS, NetMsgType::TX, | NetMsgType::GETDATA, NetMsgType::MERKLEBLOCK, NetMsgType::GETBLOCKS, | ||||
NetMsgType::HEADERS, NetMsgType::BLOCK, NetMsgType::GETADDR, | NetMsgType::GETHEADERS, NetMsgType::TX, NetMsgType::HEADERS, | ||||
NetMsgType::MEMPOOL, NetMsgType::PING, NetMsgType::PONG, | NetMsgType::BLOCK, NetMsgType::GETADDR, NetMsgType::MEMPOOL, | ||||
NetMsgType::NOTFOUND, NetMsgType::FILTERLOAD, NetMsgType::FILTERADD, | NetMsgType::PING, NetMsgType::PONG, NetMsgType::NOTFOUND, | ||||
NetMsgType::FILTERCLEAR, NetMsgType::SENDHEADERS, NetMsgType::FEEFILTER, | NetMsgType::FILTERLOAD, NetMsgType::FILTERADD, NetMsgType::FILTERCLEAR, | ||||
NetMsgType::SENDCMPCT, NetMsgType::CMPCTBLOCK, NetMsgType::GETBLOCKTXN, | NetMsgType::SENDHEADERS, NetMsgType::FEEFILTER, NetMsgType::SENDCMPCT, | ||||
NetMsgType::BLOCKTXN, NetMsgType::GETCFILTERS, NetMsgType::CFILTER, | NetMsgType::CMPCTBLOCK, NetMsgType::GETBLOCKTXN, NetMsgType::BLOCKTXN, | ||||
NetMsgType::GETCFHEADERS, NetMsgType::CFHEADERS, NetMsgType::GETCFCHECKPT, | NetMsgType::GETCFILTERS, NetMsgType::CFILTER, NetMsgType::GETCFHEADERS, | ||||
NetMsgType::CFCHECKPT, | 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 202 Lines • Show Last 20 Lines |