diff options
Diffstat (limited to 'src/protocol.cpp')
-rw-r--r-- | src/protocol.cpp | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/src/protocol.cpp b/src/protocol.cpp index 27a0a2ffc1..0439d398c7 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -7,89 +7,6 @@ #include <common/system.h> -#include <atomic> - -static std::atomic<bool> g_initial_block_download_completed(false); - -namespace NetMsgType { -const char* VERSION = "version"; -const char* VERACK = "verack"; -const char* ADDR = "addr"; -const char* ADDRV2 = "addrv2"; -const char* SENDADDRV2 = "sendaddrv2"; -const char* INV = "inv"; -const char* GETDATA = "getdata"; -const char* MERKLEBLOCK = "merkleblock"; -const char* GETBLOCKS = "getblocks"; -const char* GETHEADERS = "getheaders"; -const char* TX = "tx"; -const char* HEADERS = "headers"; -const char* BLOCK = "block"; -const char* GETADDR = "getaddr"; -const char* MEMPOOL = "mempool"; -const char* PING = "ping"; -const char* PONG = "pong"; -const char* NOTFOUND = "notfound"; -const char* FILTERLOAD = "filterload"; -const char* FILTERADD = "filteradd"; -const char* FILTERCLEAR = "filterclear"; -const char* SENDHEADERS = "sendheaders"; -const char* FEEFILTER = "feefilter"; -const char* SENDCMPCT = "sendcmpct"; -const char* CMPCTBLOCK = "cmpctblock"; -const char* GETBLOCKTXN = "getblocktxn"; -const char* BLOCKTXN = "blocktxn"; -const char* GETCFILTERS = "getcfilters"; -const char* CFILTER = "cfilter"; -const char* GETCFHEADERS = "getcfheaders"; -const char* CFHEADERS = "cfheaders"; -const char* GETCFCHECKPT = "getcfcheckpt"; -const char* CFCHECKPT = "cfcheckpt"; -const char* WTXIDRELAY = "wtxidrelay"; -const char* SENDTXRCNCL = "sendtxrcncl"; -} // namespace NetMsgType - -/** All known message types. Keep this in the same order as the list of - * messages above and in protocol.h. - */ -const static std::vector<std::string> g_all_net_message_types{ - NetMsgType::VERSION, - NetMsgType::VERACK, - NetMsgType::ADDR, - NetMsgType::ADDRV2, - NetMsgType::SENDADDRV2, - NetMsgType::INV, - NetMsgType::GETDATA, - NetMsgType::MERKLEBLOCK, - NetMsgType::GETBLOCKS, - NetMsgType::GETHEADERS, - NetMsgType::TX, - NetMsgType::HEADERS, - NetMsgType::BLOCK, - NetMsgType::GETADDR, - NetMsgType::MEMPOOL, - NetMsgType::PING, - NetMsgType::PONG, - NetMsgType::NOTFOUND, - NetMsgType::FILTERLOAD, - NetMsgType::FILTERADD, - NetMsgType::FILTERCLEAR, - NetMsgType::SENDHEADERS, - NetMsgType::FEEFILTER, - NetMsgType::SENDCMPCT, - NetMsgType::CMPCTBLOCK, - NetMsgType::GETBLOCKTXN, - NetMsgType::BLOCKTXN, - NetMsgType::GETCFILTERS, - NetMsgType::CFILTER, - NetMsgType::GETCFHEADERS, - NetMsgType::CFHEADERS, - NetMsgType::GETCFCHECKPT, - NetMsgType::CFCHECKPT, - NetMsgType::WTXIDRELAY, - NetMsgType::SENDTXRCNCL, -}; - CMessageHeader::CMessageHeader(const MessageStartChars& pchMessageStartIn, const char* pszCommand, unsigned int nMessageSizeIn) : pchMessageStart{pchMessageStartIn} { @@ -125,18 +42,6 @@ bool CMessageHeader::IsCommandValid() const return true; } - -ServiceFlags GetDesirableServiceFlags(ServiceFlags services) { - if ((services & NODE_NETWORK_LIMITED) && g_initial_block_download_completed) { - return ServiceFlags(NODE_NETWORK_LIMITED | NODE_WITNESS); - } - return ServiceFlags(NODE_NETWORK | NODE_WITNESS); -} - -void SetServiceFlagsIBDCache(bool state) { - g_initial_block_download_completed = state; -} - CInv::CInv() { type = 0; @@ -178,11 +83,6 @@ std::string CInv::ToString() const } } -const std::vector<std::string> &getAllNetMessageTypes() -{ - return g_all_net_message_types; -} - /** * Convert a service flag (NODE_*) to a human readable string. * It supports unknown service flags which will be returned as "UNKNOWN[...]". |