Skip to content

Commit fabea6d

Browse files
author
MarcoFalke
committed
net: Run clang-format on protocol.h
Can be reviewed with the git diff flags -U0 --ignore-all-space --word-diff-regex=.
1 parent facdeea commit fabea6d

File tree

1 file changed

+37
-36
lines changed

1 file changed

+37
-36
lines changed

src/protocol.h

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -74,100 +74,100 @@ namespace NetMsgType {
7474
* receiving node at the beginning of a connection.
7575
* @see https://bitcoin.org/en/developer-reference#version
7676
*/
77-
extern const char *VERSION;
77+
extern const char* VERSION;
7878
/**
7979
* The verack message acknowledges a previously-received version message,
8080
* informing the connecting node that it can begin to send other messages.
8181
* @see https://bitcoin.org/en/developer-reference#verack
8282
*/
83-
extern const char *VERACK;
83+
extern const char* VERACK;
8484
/**
8585
* The addr (IP address) message relays connection information for peers on the
8686
* network.
8787
* @see https://bitcoin.org/en/developer-reference#addr
8888
*/
89-
extern const char *ADDR;
89+
extern const char* ADDR;
9090
/**
9191
* The inv message (inventory message) transmits one or more inventories of
9292
* objects known to the transmitting peer.
9393
* @see https://bitcoin.org/en/developer-reference#inv
9494
*/
95-
extern const char *INV;
95+
extern const char* INV;
9696
/**
9797
* The getdata message requests one or more data objects from another node.
9898
* @see https://bitcoin.org/en/developer-reference#getdata
9999
*/
100-
extern const char *GETDATA;
100+
extern const char* GETDATA;
101101
/**
102102
* The merkleblock message is a reply to a getdata message which requested a
103103
* block using the inventory type MSG_MERKLEBLOCK.
104104
* @since protocol version 70001 as described by BIP37.
105105
* @see https://bitcoin.org/en/developer-reference#merkleblock
106106
*/
107-
extern const char *MERKLEBLOCK;
107+
extern const char* MERKLEBLOCK;
108108
/**
109109
* The getblocks message requests an inv message that provides block header
110110
* hashes starting from a particular point in the block chain.
111111
* @see https://bitcoin.org/en/developer-reference#getblocks
112112
*/
113-
extern const char *GETBLOCKS;
113+
extern const char* GETBLOCKS;
114114
/**
115115
* The getheaders message requests a headers message that provides block
116116
* headers starting from a particular point in the block chain.
117117
* @since protocol version 31800.
118118
* @see https://bitcoin.org/en/developer-reference#getheaders
119119
*/
120-
extern const char *GETHEADERS;
120+
extern const char* GETHEADERS;
121121
/**
122122
* The tx message transmits a single transaction.
123123
* @see https://bitcoin.org/en/developer-reference#tx
124124
*/
125-
extern const char *TX;
125+
extern const char* TX;
126126
/**
127127
* The headers message sends one or more block headers to a node which
128128
* previously requested certain headers with a getheaders message.
129129
* @since protocol version 31800.
130130
* @see https://bitcoin.org/en/developer-reference#headers
131131
*/
132-
extern const char *HEADERS;
132+
extern const char* HEADERS;
133133
/**
134134
* The block message transmits a single serialized block.
135135
* @see https://bitcoin.org/en/developer-reference#block
136136
*/
137-
extern const char *BLOCK;
137+
extern const char* BLOCK;
138138
/**
139139
* The getaddr message requests an addr message from the receiving node,
140140
* preferably one with lots of IP addresses of other receiving nodes.
141141
* @see https://bitcoin.org/en/developer-reference#getaddr
142142
*/
143-
extern const char *GETADDR;
143+
extern const char* GETADDR;
144144
/**
145145
* The mempool message requests the TXIDs of transactions that the receiving
146146
* node has verified as valid but which have not yet appeared in a block.
147147
* @since protocol version 60002.
148148
* @see https://bitcoin.org/en/developer-reference#mempool
149149
*/
150-
extern const char *MEMPOOL;
150+
extern const char* MEMPOOL;
151151
/**
152152
* The ping message is sent periodically to help confirm that the receiving
153153
* peer is still connected.
154154
* @see https://bitcoin.org/en/developer-reference#ping
155155
*/
156-
extern const char *PING;
156+
extern const char* PING;
157157
/**
158158
* The pong message replies to a ping message, proving to the pinging node that
159159
* the ponging node is still alive.
160160
* @since protocol version 60001 as described by BIP31.
161161
* @see https://bitcoin.org/en/developer-reference#pong
162162
*/
163-
extern const char *PONG;
163+
extern const char* PONG;
164164
/**
165165
* The notfound message is a reply to a getdata message which requested an
166166
* object the receiving node does not have available for relay.
167167
* @since protocol version 70001.
168168
* @see https://bitcoin.org/en/developer-reference#notfound
169169
*/
170-
extern const char *NOTFOUND;
170+
extern const char* NOTFOUND;
171171
/**
172172
* The filterload message tells the receiving peer to filter all relayed
173173
* transactions and requested merkle blocks through the provided filter.
@@ -176,7 +176,7 @@ extern const char *NOTFOUND;
176176
* 70011 as described by BIP111.
177177
* @see https://bitcoin.org/en/developer-reference#filterload
178178
*/
179-
extern const char *FILTERLOAD;
179+
extern const char* FILTERLOAD;
180180
/**
181181
* The filteradd message tells the receiving peer to add a single element to a
182182
* previously-set bloom filter, such as a new public key.
@@ -185,7 +185,7 @@ extern const char *FILTERLOAD;
185185
* 70011 as described by BIP111.
186186
* @see https://bitcoin.org/en/developer-reference#filteradd
187187
*/
188-
extern const char *FILTERADD;
188+
extern const char* FILTERADD;
189189
/**
190190
* The filterclear message tells the receiving peer to remove a previously-set
191191
* bloom filter.
@@ -194,64 +194,64 @@ extern const char *FILTERADD;
194194
* 70011 as described by BIP111.
195195
* @see https://bitcoin.org/en/developer-reference#filterclear
196196
*/
197-
extern const char *FILTERCLEAR;
197+
extern const char* FILTERCLEAR;
198198
/**
199199
* Indicates that a node prefers to receive new block announcements via a
200200
* "headers" message rather than an "inv".
201201
* @since protocol version 70012 as described by BIP130.
202202
* @see https://bitcoin.org/en/developer-reference#sendheaders
203203
*/
204-
extern const char *SENDHEADERS;
204+
extern const char* SENDHEADERS;
205205
/**
206206
* The feefilter message tells the receiving peer not to inv us any txs
207207
* which do not meet the specified min fee rate.
208208
* @since protocol version 70013 as described by BIP133
209209
*/
210-
extern const char *FEEFILTER;
210+
extern const char* FEEFILTER;
211211
/**
212212
* Contains a 1-byte bool and 8-byte LE version number.
213213
* Indicates that a node is willing to provide blocks via "cmpctblock" messages.
214214
* May indicate that a node prefers to receive new block announcements via a
215215
* "cmpctblock" message rather than an "inv", depending on message contents.
216216
* @since protocol version 70014 as described by BIP 152
217217
*/
218-
extern const char *SENDCMPCT;
218+
extern const char* SENDCMPCT;
219219
/**
220220
* Contains a CBlockHeaderAndShortTxIDs object - providing a header and
221221
* list of "short txids".
222222
* @since protocol version 70014 as described by BIP 152
223223
*/
224-
extern const char *CMPCTBLOCK;
224+
extern const char* CMPCTBLOCK;
225225
/**
226226
* Contains a BlockTransactionsRequest
227227
* Peer should respond with "blocktxn" message.
228228
* @since protocol version 70014 as described by BIP 152
229229
*/
230-
extern const char *GETBLOCKTXN;
230+
extern const char* GETBLOCKTXN;
231231
/**
232232
* Contains a BlockTransactions.
233233
* Sent in response to a "getblocktxn" message.
234234
* @since protocol version 70014 as described by BIP 152
235235
*/
236-
extern const char *BLOCKTXN;
236+
extern const char* BLOCKTXN;
237237
/**
238238
* getcfcheckpt requests evenly spaced compact filter headers, enabling
239239
* parallelized download and validation of the headers between them.
240240
* Only available with service bit NODE_COMPACT_FILTERS as described by
241241
* BIP 157 & 158.
242242
*/
243-
extern const char *GETCFCHECKPT;
243+
extern const char* GETCFCHECKPT;
244244
/**
245245
* cfcheckpt is a response to a getcfcheckpt request containing a vector of
246246
* evenly spaced filter headers for blocks on the requested chain.
247247
* Only available with service bit NODE_COMPACT_FILTERS as described by
248248
* BIP 157 & 158.
249249
*/
250-
extern const char *CFCHECKPT;
251-
};
250+
extern const char* CFCHECKPT;
251+
}; // namespace NetMsgType
252252

253253
/* Get a vector of all valid message types (see above) */
254-
const std::vector<std::string> &getAllNetMessageTypes();
254+
const std::vector<std::string>& getAllNetMessageTypes();
255255

256256
/** nServices flags */
257257
enum ServiceFlags : uint64_t {
@@ -320,15 +320,17 @@ void SetServiceFlagsIBDCache(bool status);
320320
* == GetDesirableServiceFlags(services), ie determines whether the given
321321
* set of service flags are sufficient for a peer to be "relevant".
322322
*/
323-
static inline bool HasAllDesirableServiceFlags(ServiceFlags services) {
323+
static inline bool HasAllDesirableServiceFlags(ServiceFlags services)
324+
{
324325
return !(GetDesirableServiceFlags(services) & (~services));
325326
}
326327

327328
/**
328329
* Checks if a peer with the given service flags may be capable of having a
329330
* robust address-storage DB.
330331
*/
331-
static inline bool MayHaveUsefulAddressDB(ServiceFlags services) {
332+
static inline bool MayHaveUsefulAddressDB(ServiceFlags services)
333+
{
332334
return (services & NODE_NETWORK) || (services & NODE_NETWORK_LIMITED);
333335
}
334336

@@ -368,20 +370,19 @@ class CAddress : public CService
368370

369371
/** getdata message type flags */
370372
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;
372374

373375
/** getdata / inv message types.
374376
* These numbers are defined by the protocol. When adding a new value, be sure
375377
* to mention it in the respective BIP.
376378
*/
377-
enum GetDataMsg
378-
{
379+
enum GetDataMsg {
379380
UNDEFINED = 0,
380381
MSG_TX = 1,
381382
MSG_BLOCK = 2,
382383
// 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
385386
MSG_WITNESS_BLOCK = MSG_BLOCK | MSG_WITNESS_FLAG, //!< Defined in BIP144
386387
MSG_WITNESS_TX = MSG_TX | MSG_WITNESS_FLAG, //!< Defined in BIP144
387388
MSG_FILTERED_WITNESS_BLOCK = MSG_FILTERED_BLOCK | MSG_WITNESS_FLAG,

0 commit comments

Comments
 (0)