@@ -74,100 +74,100 @@ namespace NetMsgType {
74
74
* receiving node at the beginning of a connection.
75
75
* @see https://bitcoin.org/en/developer-reference#version
76
76
*/
77
- extern const char * VERSION;
77
+ extern const char * VERSION;
78
78
/* *
79
79
* The verack message acknowledges a previously-received version message,
80
80
* informing the connecting node that it can begin to send other messages.
81
81
* @see https://bitcoin.org/en/developer-reference#verack
82
82
*/
83
- extern const char * VERACK;
83
+ extern const char * VERACK;
84
84
/* *
85
85
* The addr (IP address) message relays connection information for peers on the
86
86
* network.
87
87
* @see https://bitcoin.org/en/developer-reference#addr
88
88
*/
89
- extern const char * ADDR;
89
+ extern const char * ADDR;
90
90
/* *
91
91
* The inv message (inventory message) transmits one or more inventories of
92
92
* objects known to the transmitting peer.
93
93
* @see https://bitcoin.org/en/developer-reference#inv
94
94
*/
95
- extern const char * INV;
95
+ extern const char * INV;
96
96
/* *
97
97
* The getdata message requests one or more data objects from another node.
98
98
* @see https://bitcoin.org/en/developer-reference#getdata
99
99
*/
100
- extern const char * GETDATA;
100
+ extern const char * GETDATA;
101
101
/* *
102
102
* The merkleblock message is a reply to a getdata message which requested a
103
103
* block using the inventory type MSG_MERKLEBLOCK.
104
104
* @since protocol version 70001 as described by BIP37.
105
105
* @see https://bitcoin.org/en/developer-reference#merkleblock
106
106
*/
107
- extern const char * MERKLEBLOCK;
107
+ extern const char * MERKLEBLOCK;
108
108
/* *
109
109
* The getblocks message requests an inv message that provides block header
110
110
* hashes starting from a particular point in the block chain.
111
111
* @see https://bitcoin.org/en/developer-reference#getblocks
112
112
*/
113
- extern const char * GETBLOCKS;
113
+ extern const char * GETBLOCKS;
114
114
/* *
115
115
* The getheaders message requests a headers message that provides block
116
116
* headers starting from a particular point in the block chain.
117
117
* @since protocol version 31800.
118
118
* @see https://bitcoin.org/en/developer-reference#getheaders
119
119
*/
120
- extern const char * GETHEADERS;
120
+ extern const char * GETHEADERS;
121
121
/* *
122
122
* The tx message transmits a single transaction.
123
123
* @see https://bitcoin.org/en/developer-reference#tx
124
124
*/
125
- extern const char * TX;
125
+ extern const char * TX;
126
126
/* *
127
127
* The headers message sends one or more block headers to a node which
128
128
* previously requested certain headers with a getheaders message.
129
129
* @since protocol version 31800.
130
130
* @see https://bitcoin.org/en/developer-reference#headers
131
131
*/
132
- extern const char * HEADERS;
132
+ extern const char * HEADERS;
133
133
/* *
134
134
* The block message transmits a single serialized block.
135
135
* @see https://bitcoin.org/en/developer-reference#block
136
136
*/
137
- extern const char * BLOCK;
137
+ extern const char * BLOCK;
138
138
/* *
139
139
* The getaddr message requests an addr message from the receiving node,
140
140
* preferably one with lots of IP addresses of other receiving nodes.
141
141
* @see https://bitcoin.org/en/developer-reference#getaddr
142
142
*/
143
- extern const char * GETADDR;
143
+ extern const char * GETADDR;
144
144
/* *
145
145
* The mempool message requests the TXIDs of transactions that the receiving
146
146
* node has verified as valid but which have not yet appeared in a block.
147
147
* @since protocol version 60002.
148
148
* @see https://bitcoin.org/en/developer-reference#mempool
149
149
*/
150
- extern const char * MEMPOOL;
150
+ extern const char * MEMPOOL;
151
151
/* *
152
152
* The ping message is sent periodically to help confirm that the receiving
153
153
* peer is still connected.
154
154
* @see https://bitcoin.org/en/developer-reference#ping
155
155
*/
156
- extern const char * PING;
156
+ extern const char * PING;
157
157
/* *
158
158
* The pong message replies to a ping message, proving to the pinging node that
159
159
* the ponging node is still alive.
160
160
* @since protocol version 60001 as described by BIP31.
161
161
* @see https://bitcoin.org/en/developer-reference#pong
162
162
*/
163
- extern const char * PONG;
163
+ extern const char * PONG;
164
164
/* *
165
165
* The notfound message is a reply to a getdata message which requested an
166
166
* object the receiving node does not have available for relay.
167
167
* @since protocol version 70001.
168
168
* @see https://bitcoin.org/en/developer-reference#notfound
169
169
*/
170
- extern const char * NOTFOUND;
170
+ extern const char * NOTFOUND;
171
171
/* *
172
172
* The filterload message tells the receiving peer to filter all relayed
173
173
* transactions and requested merkle blocks through the provided filter.
@@ -176,7 +176,7 @@ extern const char *NOTFOUND;
176
176
* 70011 as described by BIP111.
177
177
* @see https://bitcoin.org/en/developer-reference#filterload
178
178
*/
179
- extern const char * FILTERLOAD;
179
+ extern const char * FILTERLOAD;
180
180
/* *
181
181
* The filteradd message tells the receiving peer to add a single element to a
182
182
* previously-set bloom filter, such as a new public key.
@@ -185,7 +185,7 @@ extern const char *FILTERLOAD;
185
185
* 70011 as described by BIP111.
186
186
* @see https://bitcoin.org/en/developer-reference#filteradd
187
187
*/
188
- extern const char * FILTERADD;
188
+ extern const char * FILTERADD;
189
189
/* *
190
190
* The filterclear message tells the receiving peer to remove a previously-set
191
191
* bloom filter.
@@ -194,64 +194,64 @@ extern const char *FILTERADD;
194
194
* 70011 as described by BIP111.
195
195
* @see https://bitcoin.org/en/developer-reference#filterclear
196
196
*/
197
- extern const char * FILTERCLEAR;
197
+ extern const char * FILTERCLEAR;
198
198
/* *
199
199
* Indicates that a node prefers to receive new block announcements via a
200
200
* "headers" message rather than an "inv".
201
201
* @since protocol version 70012 as described by BIP130.
202
202
* @see https://bitcoin.org/en/developer-reference#sendheaders
203
203
*/
204
- extern const char * SENDHEADERS;
204
+ extern const char * SENDHEADERS;
205
205
/* *
206
206
* The feefilter message tells the receiving peer not to inv us any txs
207
207
* which do not meet the specified min fee rate.
208
208
* @since protocol version 70013 as described by BIP133
209
209
*/
210
- extern const char * FEEFILTER;
210
+ extern const char * FEEFILTER;
211
211
/* *
212
212
* Contains a 1-byte bool and 8-byte LE version number.
213
213
* Indicates that a node is willing to provide blocks via "cmpctblock" messages.
214
214
* May indicate that a node prefers to receive new block announcements via a
215
215
* "cmpctblock" message rather than an "inv", depending on message contents.
216
216
* @since protocol version 70014 as described by BIP 152
217
217
*/
218
- extern const char * SENDCMPCT;
218
+ extern const char * SENDCMPCT;
219
219
/* *
220
220
* Contains a CBlockHeaderAndShortTxIDs object - providing a header and
221
221
* list of "short txids".
222
222
* @since protocol version 70014 as described by BIP 152
223
223
*/
224
- extern const char * CMPCTBLOCK;
224
+ extern const char * CMPCTBLOCK;
225
225
/* *
226
226
* Contains a BlockTransactionsRequest
227
227
* Peer should respond with "blocktxn" message.
228
228
* @since protocol version 70014 as described by BIP 152
229
229
*/
230
- extern const char * GETBLOCKTXN;
230
+ extern const char * GETBLOCKTXN;
231
231
/* *
232
232
* Contains a BlockTransactions.
233
233
* Sent in response to a "getblocktxn" message.
234
234
* @since protocol version 70014 as described by BIP 152
235
235
*/
236
- extern const char * BLOCKTXN;
236
+ extern const char * BLOCKTXN;
237
237
/* *
238
238
* getcfcheckpt requests evenly spaced compact filter headers, enabling
239
239
* parallelized download and validation of the headers between them.
240
240
* Only available with service bit NODE_COMPACT_FILTERS as described by
241
241
* BIP 157 & 158.
242
242
*/
243
- extern const char * GETCFCHECKPT;
243
+ extern const char * GETCFCHECKPT;
244
244
/* *
245
245
* cfcheckpt is a response to a getcfcheckpt request containing a vector of
246
246
* evenly spaced filter headers for blocks on the requested chain.
247
247
* Only available with service bit NODE_COMPACT_FILTERS as described by
248
248
* BIP 157 & 158.
249
249
*/
250
- extern const char * CFCHECKPT;
251
- };
250
+ extern const char * CFCHECKPT;
251
+ }; // namespace NetMsgType
252
252
253
253
/* Get a vector of all valid message types (see above) */
254
- const std::vector<std::string> & getAllNetMessageTypes ();
254
+ const std::vector<std::string>& getAllNetMessageTypes ();
255
255
256
256
/* * nServices flags */
257
257
enum ServiceFlags : uint64_t {
@@ -320,15 +320,17 @@ void SetServiceFlagsIBDCache(bool status);
320
320
* == GetDesirableServiceFlags(services), ie determines whether the given
321
321
* set of service flags are sufficient for a peer to be "relevant".
322
322
*/
323
- static inline bool HasAllDesirableServiceFlags (ServiceFlags services) {
323
+ static inline bool HasAllDesirableServiceFlags (ServiceFlags services)
324
+ {
324
325
return !(GetDesirableServiceFlags (services) & (~services));
325
326
}
326
327
327
328
/* *
328
329
* Checks if a peer with the given service flags may be capable of having a
329
330
* robust address-storage DB.
330
331
*/
331
- static inline bool MayHaveUsefulAddressDB (ServiceFlags services) {
332
+ static inline bool MayHaveUsefulAddressDB (ServiceFlags services)
333
+ {
332
334
return (services & NODE_NETWORK) || (services & NODE_NETWORK_LIMITED);
333
335
}
334
336
@@ -368,20 +370,19 @@ class CAddress : public CService
368
370
369
371
/* * getdata message type flags */
370
372
const uint32_t MSG_WITNESS_FLAG = 1 << 30 ;
371
- const uint32_t MSG_TYPE_MASK = 0xffffffff >> 2 ;
373
+ const uint32_t MSG_TYPE_MASK = 0xffffffff >> 2 ;
372
374
373
375
/* * getdata / inv message types.
374
376
* These numbers are defined by the protocol. When adding a new value, be sure
375
377
* to mention it in the respective BIP.
376
378
*/
377
- enum GetDataMsg
378
- {
379
+ enum GetDataMsg {
379
380
UNDEFINED = 0 ,
380
381
MSG_TX = 1 ,
381
382
MSG_BLOCK = 2 ,
382
383
// The following can only occur in getdata. Invs always use TX or BLOCK.
383
- MSG_FILTERED_BLOCK = 3 , // !< Defined in BIP37
384
- MSG_CMPCT_BLOCK = 4 , // !< Defined in BIP152
384
+ MSG_FILTERED_BLOCK = 3 , // !< Defined in BIP37
385
+ MSG_CMPCT_BLOCK = 4 , // !< Defined in BIP152
385
386
MSG_WITNESS_BLOCK = MSG_BLOCK | MSG_WITNESS_FLAG, // !< Defined in BIP144
386
387
MSG_WITNESS_TX = MSG_TX | MSG_WITNESS_FLAG, // !< Defined in BIP144
387
388
MSG_FILTERED_WITNESS_BLOCK = MSG_FILTERED_BLOCK | MSG_WITNESS_FLAG,
0 commit comments