@@ -58,213 +58,212 @@ class CMessageHeader
58
58
* to update ALL_NET_MESSAGE_TYPES below.
59
59
*/
60
60
namespace NetMsgType {
61
-
62
61
/* *
63
62
* The version message provides information about the transmitting node to the
64
63
* receiving node at the beginning of a connection.
65
64
*/
66
- extern const char * VERSION;
65
+ inline constexpr const char * VERSION{ " version " } ;
67
66
/* *
68
67
* The verack message acknowledges a previously-received version message,
69
68
* informing the connecting node that it can begin to send other messages.
70
69
*/
71
- extern const char * VERACK;
70
+ inline constexpr const char * VERACK{ " verack " } ;
72
71
/* *
73
72
* The addr (IP address) message relays connection information for peers on the
74
73
* network.
75
74
*/
76
- extern const char * ADDR;
75
+ inline constexpr const char * ADDR{ " addr " } ;
77
76
/* *
78
77
* The addrv2 message relays connection information for peers on the network just
79
78
* like the addr message, but is extended to allow gossiping of longer node
80
79
* addresses (see BIP155).
81
80
*/
82
- extern const char * ADDRV2;
81
+ inline constexpr const char * ADDRV2{ " addrv2 " } ;
83
82
/* *
84
83
* The sendaddrv2 message signals support for receiving ADDRV2 messages (BIP155).
85
84
* It also implies that its sender can encode as ADDRV2 and would send ADDRV2
86
85
* instead of ADDR to a peer that has signaled ADDRV2 support by sending SENDADDRV2.
87
86
*/
88
- extern const char * SENDADDRV2;
87
+ inline constexpr const char * SENDADDRV2{ " sendaddrv2 " } ;
89
88
/* *
90
89
* The inv message (inventory message) transmits one or more inventories of
91
90
* objects known to the transmitting peer.
92
91
*/
93
- extern const char * INV;
92
+ inline constexpr const char * INV{ " inv " } ;
94
93
/* *
95
94
* The getdata message requests one or more data objects from another node.
96
95
*/
97
- extern const char * GETDATA;
96
+ inline constexpr const char * GETDATA{ " getdata " } ;
98
97
/* *
99
98
* The merkleblock message is a reply to a getdata message which requested a
100
99
* block using the inventory type MSG_MERKLEBLOCK.
101
100
* @since protocol version 70001 as described by BIP37.
102
101
*/
103
- extern const char * MERKLEBLOCK;
102
+ inline constexpr const char * MERKLEBLOCK{ " merkleblock " } ;
104
103
/* *
105
104
* The getblocks message requests an inv message that provides block header
106
105
* hashes starting from a particular point in the block chain.
107
106
*/
108
- extern const char * GETBLOCKS;
107
+ inline constexpr const char * GETBLOCKS{ " getblocks " } ;
109
108
/* *
110
109
* The getheaders message requests a headers message that provides block
111
110
* headers starting from a particular point in the block chain.
112
111
* @since protocol version 31800.
113
112
*/
114
- extern const char * GETHEADERS;
113
+ inline constexpr const char * GETHEADERS{ " getheaders " } ;
115
114
/* *
116
115
* The tx message transmits a single transaction.
117
116
*/
118
- extern const char * TX;
117
+ inline constexpr const char * TX{ " tx " } ;
119
118
/* *
120
119
* The headers message sends one or more block headers to a node which
121
120
* previously requested certain headers with a getheaders message.
122
121
* @since protocol version 31800.
123
122
*/
124
- extern const char * HEADERS;
123
+ inline constexpr const char * HEADERS{ " headers " } ;
125
124
/* *
126
125
* The block message transmits a single serialized block.
127
126
*/
128
- extern const char * BLOCK;
127
+ inline constexpr const char * BLOCK{ " block " } ;
129
128
/* *
130
129
* The getaddr message requests an addr message from the receiving node,
131
130
* preferably one with lots of IP addresses of other receiving nodes.
132
131
*/
133
- extern const char * GETADDR;
132
+ inline constexpr const char * GETADDR{ " getaddr " } ;
134
133
/* *
135
134
* The mempool message requests the TXIDs of transactions that the receiving
136
135
* node has verified as valid but which have not yet appeared in a block.
137
136
* @since protocol version 60002 as described by BIP35.
138
137
* Only available with service bit NODE_BLOOM, see also BIP111.
139
138
*/
140
- extern const char * MEMPOOL;
139
+ inline constexpr const char * MEMPOOL{ " mempool " } ;
141
140
/* *
142
141
* The ping message is sent periodically to help confirm that the receiving
143
142
* peer is still connected.
144
143
*/
145
- extern const char * PING;
144
+ inline constexpr const char * PING{ " ping " } ;
146
145
/* *
147
146
* The pong message replies to a ping message, proving to the pinging node that
148
147
* the ponging node is still alive.
149
148
* @since protocol version 60001 as described by BIP31.
150
149
*/
151
- extern const char * PONG;
150
+ inline constexpr const char * PONG{ " pong " } ;
152
151
/* *
153
152
* The notfound message is a reply to a getdata message which requested an
154
153
* object the receiving node does not have available for relay.
155
154
* @since protocol version 70001.
156
155
*/
157
- extern const char * NOTFOUND;
156
+ inline constexpr const char * NOTFOUND{ " notfound " } ;
158
157
/* *
159
158
* The filterload message tells the receiving peer to filter all relayed
160
159
* transactions and requested merkle blocks through the provided filter.
161
160
* @since protocol version 70001 as described by BIP37.
162
161
* Only available with service bit NODE_BLOOM since protocol version
163
162
* 70011 as described by BIP111.
164
163
*/
165
- extern const char * FILTERLOAD;
164
+ inline constexpr const char * FILTERLOAD{ " filterload " } ;
166
165
/* *
167
166
* The filteradd message tells the receiving peer to add a single element to a
168
167
* previously-set bloom filter, such as a new public key.
169
168
* @since protocol version 70001 as described by BIP37.
170
169
* Only available with service bit NODE_BLOOM since protocol version
171
170
* 70011 as described by BIP111.
172
171
*/
173
- extern const char * FILTERADD;
172
+ inline constexpr const char * FILTERADD{ " filteradd " } ;
174
173
/* *
175
174
* The filterclear message tells the receiving peer to remove a previously-set
176
175
* bloom filter.
177
176
* @since protocol version 70001 as described by BIP37.
178
177
* Only available with service bit NODE_BLOOM since protocol version
179
178
* 70011 as described by BIP111.
180
179
*/
181
- extern const char * FILTERCLEAR;
180
+ inline constexpr const char * FILTERCLEAR{ " filterclear " } ;
182
181
/* *
183
182
* Indicates that a node prefers to receive new block announcements via a
184
183
* "headers" message rather than an "inv".
185
184
* @since protocol version 70012 as described by BIP130.
186
185
*/
187
- extern const char * SENDHEADERS;
186
+ inline constexpr const char * SENDHEADERS{ " sendheaders " } ;
188
187
/* *
189
188
* The feefilter message tells the receiving peer not to inv us any txs
190
189
* which do not meet the specified min fee rate.
191
190
* @since protocol version 70013 as described by BIP133
192
191
*/
193
- extern const char * FEEFILTER;
192
+ inline constexpr const char * FEEFILTER{ " feefilter " } ;
194
193
/* *
195
194
* Contains a 1-byte bool and 8-byte LE version number.
196
195
* Indicates that a node is willing to provide blocks via "cmpctblock" messages.
197
196
* May indicate that a node prefers to receive new block announcements via a
198
197
* "cmpctblock" message rather than an "inv", depending on message contents.
199
198
* @since protocol version 70014 as described by BIP 152
200
199
*/
201
- extern const char * SENDCMPCT;
200
+ inline constexpr const char * SENDCMPCT{ " sendcmpct " } ;
202
201
/* *
203
202
* Contains a CBlockHeaderAndShortTxIDs object - providing a header and
204
203
* list of "short txids".
205
204
* @since protocol version 70014 as described by BIP 152
206
205
*/
207
- extern const char * CMPCTBLOCK;
206
+ inline constexpr const char * CMPCTBLOCK{ " cmpctblock " } ;
208
207
/* *
209
208
* Contains a BlockTransactionsRequest
210
209
* Peer should respond with "blocktxn" message.
211
210
* @since protocol version 70014 as described by BIP 152
212
211
*/
213
- extern const char * GETBLOCKTXN;
212
+ inline constexpr const char * GETBLOCKTXN{ " getblocktxn " } ;
214
213
/* *
215
214
* Contains a BlockTransactions.
216
215
* Sent in response to a "getblocktxn" message.
217
216
* @since protocol version 70014 as described by BIP 152
218
217
*/
219
- extern const char * BLOCKTXN;
218
+ inline constexpr const char * BLOCKTXN{ " blocktxn " } ;
220
219
/* *
221
220
* getcfilters requests compact filters for a range of blocks.
222
221
* Only available with service bit NODE_COMPACT_FILTERS as described by
223
222
* BIP 157 & 158.
224
223
*/
225
- extern const char * GETCFILTERS;
224
+ inline constexpr const char * GETCFILTERS{ " getcfilters " } ;
226
225
/* *
227
226
* cfilter is a response to a getcfilters request containing a single compact
228
227
* filter.
229
228
*/
230
- extern const char * CFILTER;
229
+ inline constexpr const char * CFILTER{ " cfilter " } ;
231
230
/* *
232
231
* getcfheaders requests a compact filter header and the filter hashes for a
233
232
* range of blocks, which can then be used to reconstruct the filter headers
234
233
* for those blocks.
235
234
* Only available with service bit NODE_COMPACT_FILTERS as described by
236
235
* BIP 157 & 158.
237
236
*/
238
- extern const char * GETCFHEADERS;
237
+ inline constexpr const char * GETCFHEADERS{ " getcfheaders " } ;
239
238
/* *
240
239
* cfheaders is a response to a getcfheaders request containing a filter header
241
240
* and a vector of filter hashes for each subsequent block in the requested range.
242
241
*/
243
- extern const char * CFHEADERS;
242
+ inline constexpr const char * CFHEADERS{ " cfheaders " } ;
244
243
/* *
245
244
* getcfcheckpt requests evenly spaced compact filter headers, enabling
246
245
* parallelized download and validation of the headers between them.
247
246
* Only available with service bit NODE_COMPACT_FILTERS as described by
248
247
* BIP 157 & 158.
249
248
*/
250
- extern const char * GETCFCHECKPT;
249
+ inline constexpr const char * GETCFCHECKPT{ " getcfcheckpt " } ;
251
250
/* *
252
251
* cfcheckpt is a response to a getcfcheckpt request containing a vector of
253
252
* evenly spaced filter headers for blocks on the requested chain.
254
253
*/
255
- extern const char * CFCHECKPT;
254
+ inline constexpr const char * CFCHECKPT{ " cfcheckpt " } ;
256
255
/* *
257
256
* Indicates that a node prefers to relay transactions via wtxid, rather than
258
257
* txid.
259
258
* @since protocol version 70016 as described by BIP 339.
260
259
*/
261
- extern const char * WTXIDRELAY;
260
+ inline constexpr const char * WTXIDRELAY{ " wtxidrelay " } ;
262
261
/* *
263
262
* Contains a 4-byte version number and an 8-byte salt.
264
263
* The salt is used to compute short txids needed for efficient
265
264
* txreconciliation, as described by BIP 330.
266
265
*/
267
- extern const char * SENDTXRCNCL;
266
+ inline constexpr const char * SENDTXRCNCL{ " sendtxrcncl " } ;
268
267
}; // namespace NetMsgType
269
268
270
269
/* * All known message types (see above). Keep this in the same order as the list of messages above. */
0 commit comments