|
7 | 7 |
|
8 | 8 | #include <common/system.h>
|
9 | 9 |
|
10 |
| -#include <atomic> |
11 |
| - |
12 |
| -namespace NetMsgType { |
13 |
| -const char* VERSION = "version"; |
14 |
| -const char* VERACK = "verack"; |
15 |
| -const char* ADDR = "addr"; |
16 |
| -const char* ADDRV2 = "addrv2"; |
17 |
| -const char* SENDADDRV2 = "sendaddrv2"; |
18 |
| -const char* INV = "inv"; |
19 |
| -const char* GETDATA = "getdata"; |
20 |
| -const char* MERKLEBLOCK = "merkleblock"; |
21 |
| -const char* GETBLOCKS = "getblocks"; |
22 |
| -const char* GETHEADERS = "getheaders"; |
23 |
| -const char* TX = "tx"; |
24 |
| -const char* HEADERS = "headers"; |
25 |
| -const char* BLOCK = "block"; |
26 |
| -const char* GETADDR = "getaddr"; |
27 |
| -const char* MEMPOOL = "mempool"; |
28 |
| -const char* PING = "ping"; |
29 |
| -const char* PONG = "pong"; |
30 |
| -const char* NOTFOUND = "notfound"; |
31 |
| -const char* FILTERLOAD = "filterload"; |
32 |
| -const char* FILTERADD = "filteradd"; |
33 |
| -const char* FILTERCLEAR = "filterclear"; |
34 |
| -const char* SENDHEADERS = "sendheaders"; |
35 |
| -const char* FEEFILTER = "feefilter"; |
36 |
| -const char* SENDCMPCT = "sendcmpct"; |
37 |
| -const char* CMPCTBLOCK = "cmpctblock"; |
38 |
| -const char* GETBLOCKTXN = "getblocktxn"; |
39 |
| -const char* BLOCKTXN = "blocktxn"; |
40 |
| -const char* GETCFILTERS = "getcfilters"; |
41 |
| -const char* CFILTER = "cfilter"; |
42 |
| -const char* GETCFHEADERS = "getcfheaders"; |
43 |
| -const char* CFHEADERS = "cfheaders"; |
44 |
| -const char* GETCFCHECKPT = "getcfcheckpt"; |
45 |
| -const char* CFCHECKPT = "cfcheckpt"; |
46 |
| -const char* WTXIDRELAY = "wtxidrelay"; |
47 |
| -const char* SENDTXRCNCL = "sendtxrcncl"; |
48 |
| -} // namespace NetMsgType |
49 |
| - |
50 |
| -/** All known message types. Keep this in the same order as the list of |
51 |
| - * messages above and in protocol.h. |
52 |
| - */ |
53 |
| -const static std::vector<std::string> g_all_net_message_types{ |
54 |
| - NetMsgType::VERSION, |
55 |
| - NetMsgType::VERACK, |
56 |
| - NetMsgType::ADDR, |
57 |
| - NetMsgType::ADDRV2, |
58 |
| - NetMsgType::SENDADDRV2, |
59 |
| - NetMsgType::INV, |
60 |
| - NetMsgType::GETDATA, |
61 |
| - NetMsgType::MERKLEBLOCK, |
62 |
| - NetMsgType::GETBLOCKS, |
63 |
| - NetMsgType::GETHEADERS, |
64 |
| - NetMsgType::TX, |
65 |
| - NetMsgType::HEADERS, |
66 |
| - NetMsgType::BLOCK, |
67 |
| - NetMsgType::GETADDR, |
68 |
| - NetMsgType::MEMPOOL, |
69 |
| - NetMsgType::PING, |
70 |
| - NetMsgType::PONG, |
71 |
| - NetMsgType::NOTFOUND, |
72 |
| - NetMsgType::FILTERLOAD, |
73 |
| - NetMsgType::FILTERADD, |
74 |
| - NetMsgType::FILTERCLEAR, |
75 |
| - NetMsgType::SENDHEADERS, |
76 |
| - NetMsgType::FEEFILTER, |
77 |
| - NetMsgType::SENDCMPCT, |
78 |
| - NetMsgType::CMPCTBLOCK, |
79 |
| - NetMsgType::GETBLOCKTXN, |
80 |
| - NetMsgType::BLOCKTXN, |
81 |
| - NetMsgType::GETCFILTERS, |
82 |
| - NetMsgType::CFILTER, |
83 |
| - NetMsgType::GETCFHEADERS, |
84 |
| - NetMsgType::CFHEADERS, |
85 |
| - NetMsgType::GETCFCHECKPT, |
86 |
| - NetMsgType::CFCHECKPT, |
87 |
| - NetMsgType::WTXIDRELAY, |
88 |
| - NetMsgType::SENDTXRCNCL, |
89 |
| -}; |
90 |
| - |
91 | 10 | CMessageHeader::CMessageHeader(const MessageStartChars& pchMessageStartIn, const char* pszCommand, unsigned int nMessageSizeIn)
|
92 | 11 | : pchMessageStart{pchMessageStartIn}
|
93 | 12 | {
|
@@ -164,11 +83,6 @@ std::string CInv::ToString() const
|
164 | 83 | }
|
165 | 84 | }
|
166 | 85 |
|
167 |
| -const std::vector<std::string> &getAllNetMessageTypes() |
168 |
| -{ |
169 |
| - return g_all_net_message_types; |
170 |
| -} |
171 |
| - |
172 | 86 | /**
|
173 | 87 | * Convert a service flag (NODE_*) to a human readable string.
|
174 | 88 | * It supports unknown service flags which will be returned as "UNKNOWN[...]".
|
|
0 commit comments