Bitcoin ABC  0.24.7
P2P Digital Currency
protocol.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2019 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef __cplusplus
7 #error This header can only be compiled as C++.
8 #endif
9 
10 #ifndef BITCOIN_PROTOCOL_H
11 #define BITCOIN_PROTOCOL_H
12 
13 #include <netaddress.h>
14 #include <serialize.h>
15 #include <uint256.h>
16 #include <version.h>
17 
18 #include <array>
19 #include <cstdint>
20 #include <string>
21 
22 class Config;
23 
28 static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH = 2 * 1024 * 1024;
29 
38 public:
39  static constexpr size_t MESSAGE_START_SIZE = 4;
40  static constexpr size_t COMMAND_SIZE = 12;
41  static constexpr size_t MESSAGE_SIZE_SIZE = 4;
42  static constexpr size_t CHECKSUM_SIZE = 4;
43  static constexpr size_t MESSAGE_SIZE_OFFSET =
45  static constexpr size_t CHECKSUM_OFFSET =
47  static constexpr size_t HEADER_SIZE =
49  typedef std::array<uint8_t, MESSAGE_START_SIZE> MessageMagic;
50 
51  explicit CMessageHeader(const MessageMagic &pchMessageStartIn);
52 
59  CMessageHeader(const MessageMagic &pchMessageStartIn,
60  const char *pszCommand, unsigned int nMessageSizeIn);
61 
62  std::string GetCommand() const;
63  bool IsValid(const Config &config) const;
64  bool IsValidWithoutConfig(const MessageMagic &magic) const;
65  bool IsOversized(const Config &config) const;
66 
68  READWRITE(obj.pchMessageStart, obj.pchCommand, obj.nMessageSize,
69  obj.pchChecksum);
70  }
71 
73  std::array<char, COMMAND_SIZE> pchCommand;
74  uint32_t nMessageSize;
76 };
77 
82 namespace NetMsgType {
83 
88 extern const char *VERSION;
93 extern const char *VERACK;
98 extern const char *ADDR;
104 extern const char *ADDRV2;
111 extern const char *SENDADDRV2;
116 extern const char *INV;
120 extern const char *GETDATA;
126 extern const char *MERKLEBLOCK;
131 extern const char *GETBLOCKS;
137 extern const char *GETHEADERS;
141 extern const char *TX;
147 extern const char *HEADERS;
151 extern const char *BLOCK;
156 extern const char *GETADDR;
162 extern const char *MEMPOOL;
167 extern const char *PING;
173 extern const char *PONG;
179 extern const char *NOTFOUND;
187 extern const char *FILTERLOAD;
195 extern const char *FILTERADD;
203 extern const char *FILTERCLEAR;
209 extern const char *SENDHEADERS;
215 extern const char *FEEFILTER;
223 extern const char *SENDCMPCT;
229 extern const char *CMPCTBLOCK;
235 extern const char *GETBLOCKTXN;
241 extern const char *BLOCKTXN;
247 extern const char *GETCFILTERS;
252 extern const char *CFILTER;
260 extern const char *GETCFHEADERS;
266 extern const char *CFHEADERS;
273 extern const char *GETCFCHECKPT;
278 extern const char *CFCHECKPT;
282 extern const char *AVAHELLO;
287 extern const char *AVAPOLL;
292 extern const char *AVARESPONSE;
298 extern const char *AVAPROOF;
299 
305 bool IsBlockLike(const std::string &strCommand);
306 }; // namespace NetMsgType
307 
309 const std::vector<std::string> &getAllNetMessageTypes();
310 
314 enum ServiceFlags : uint64_t {
315  // NOTE: When adding here, be sure to update serviceFlagToStr too
316  // Nothing
318  // NODE_NETWORK means that the node is capable of serving the complete block
319  // chain. It is currently set by all Bitcoin ABC non pruned nodes, and is
320  // unset by SPV clients or other light clients.
321  NODE_NETWORK = (1 << 0),
322  // NODE_GETUTXO means the node is capable of responding to the getutxo
323  // protocol request. Bitcoin ABC does not support this but a patch set
324  // called Bitcoin XT does. See BIP 64 for details on how this is
325  // implemented.
326  NODE_GETUTXO = (1 << 1),
327  // NODE_BLOOM means the node is capable and willing to handle bloom-filtered
328  // connections. Bitcoin ABC nodes used to support this by default, without
329  // advertising this bit, but no longer do as of protocol version 70011 (=
330  // NO_BLOOM_VERSION)
331  NODE_BLOOM = (1 << 2),
332  // Bit 4 was NODE_XTHIN, removed in v0.22.12
333 
334  // Bit 5 was NODE_BITCOIN_CASH, removed in v0.22.8
335 
336  // NODE_COMPACT_FILTERS means the node will service basic block filter
337  // requests.
338  // See BIP157 and BIP158 for details on how this is implemented.
340 
341  // NODE_NETWORK_LIMITED means the same as NODE_NETWORK with the limitation
342  // of only serving the last 288 (2 day) blocks
343  // See BIP159 for details on how this is implemented.
344  NODE_NETWORK_LIMITED = (1 << 10),
345 
346  // The last non experimental service bit, helper for looping over the flags
348 
349  // Bits 24-31 are reserved for temporary experiments. Just pick a bit that
350  // isn't getting used, or one not being used much, and notify the
351  // bitcoin-development mailing list. Remember that service bits are just
352  // unauthenticated advertisements, so your code must be robust against
353  // collisions and other cases where nodes may be advertising a service they
354  // do not actually support. Other service bits should be allocated via the
355  // BIP process.
356 
357  // NODE_AVALANCHE means the node supports Bitcoin Cash's avalanche
358  // preconsensus mechanism.
359  NODE_AVALANCHE = (1 << 24),
360 };
361 
367 std::vector<std::string> serviceFlagsToStr(const uint64_t flags);
368 
394 
399 void SetServiceFlagsIBDCache(bool status);
400 
406 static inline bool HasAllDesirableServiceFlags(ServiceFlags services) {
407  return !(GetDesirableServiceFlags(services) & (~services));
408 }
409 
414 static inline bool MayHaveUsefulAddressDB(ServiceFlags services) {
415  return (services & NODE_NETWORK) || (services & NODE_NETWORK_LIMITED);
416 }
417 
421 class CAddress : public CService {
422  static constexpr uint32_t TIME_INIT{100000000};
423 
424 public:
425  CAddress() : CService{} {};
426  CAddress(CService ipIn, ServiceFlags nServicesIn)
427  : CService{ipIn}, nServices{nServicesIn} {};
428  CAddress(CService ipIn, ServiceFlags nServicesIn, uint32_t nTimeIn)
429  : CService{ipIn}, nTime{nTimeIn}, nServices{nServicesIn} {};
430 
431  void Init();
432 
434  SER_READ(obj, obj.nTime = TIME_INIT);
435  int nVersion = s.GetVersion();
436  if (s.GetType() & SER_DISK) {
437  READWRITE(nVersion);
438  }
439  if ((s.GetType() & SER_DISK) ||
440  (nVersion != INIT_PROTO_VERSION && !(s.GetType() & SER_GETHASH))) {
441  // The only time we serialize a CAddress object without nTime is in
442  // the initial VERSION messages which contain two CAddress records.
443  // At that point, the serialization version is INIT_PROTO_VERSION.
444  // After the version handshake, serialization version is >=
445  // MIN_PEER_PROTO_VERSION and all ADDR messages are serialized with
446  // nTime.
447  READWRITE(obj.nTime);
448  }
449  if (nVersion & ADDRV2_FORMAT) {
450  uint64_t services_tmp;
451  SER_WRITE(obj, services_tmp = obj.nServices);
453  SER_READ(obj,
454  obj.nServices = static_cast<ServiceFlags>(services_tmp));
455  } else {
456  READWRITE(Using<CustomUintFormatter<8>>(obj.nServices));
457  }
458  READWRITEAS(CService, obj);
459  }
460 
461  // disk and network only
462  uint32_t nTime{TIME_INIT};
463 
465 };
466 
468 const uint32_t MSG_TYPE_MASK = 0xffffffff >> 3;
469 
477  MSG_TX = 1,
479  // The following can only occur in getdata. Invs always use TX or BLOCK.
484  MSG_AVA_PROOF = 0x1f000001,
485 };
486 
492 class CInv {
493 public:
494  uint32_t type;
496 
497  CInv() : type(0), hash() {}
498  CInv(uint32_t typeIn, const uint256 &hashIn) : type(typeIn), hash(hashIn) {}
499 
500  SERIALIZE_METHODS(CInv, obj) { READWRITE(obj.type, obj.hash); }
501 
502  friend bool operator<(const CInv &a, const CInv &b) {
503  return a.type < b.type || (a.type == b.type && a.hash < b.hash);
504  }
505 
506  std::string GetCommand() const;
507  std::string ToString() const;
508 
509  uint32_t GetKind() const { return type & MSG_TYPE_MASK; }
510 
511  bool IsMsgTx() const {
512  auto k = GetKind();
513  return k == MSG_TX;
514  }
515  bool IsMsgProof() const {
516  auto k = GetKind();
517  return k == MSG_AVA_PROOF;
518  }
519  bool IsMsgBlk() const {
520  auto k = GetKind();
521  return k == MSG_BLOCK;
522  }
523  bool IsMsgFilteredBlk() const {
524  auto k = GetKind();
525  return k == MSG_FILTERED_BLOCK;
526  }
527  bool IsMsgCmpctBlk() const {
528  auto k = GetKind();
529  return k == MSG_CMPCT_BLOCK;
530  }
531 
532  bool IsGenBlkMsg() const {
533  auto k = GetKind();
534  return k == MSG_BLOCK || k == MSG_FILTERED_BLOCK ||
535  k == MSG_CMPCT_BLOCK;
536  }
537 };
538 
539 #endif // BITCOIN_PROTOCOL_H
CService
A combination of a network address (CNetAddr) and a (TCP) port.
Definition: netaddress.h:514
CMessageHeader::CHECKSUM_OFFSET
static constexpr size_t CHECKSUM_OFFSET
Definition: protocol.h:45
ADDRV2_FORMAT
static const int ADDRV2_FORMAT
A flag that is ORed into the protocol version to designate that addresses should be serialized in (un...
Definition: netaddress.h:32
NetMsgType
Bitcoin protocol message types.
Definition: protocol.cpp:17
MSG_FILTERED_BLOCK
@ MSG_FILTERED_BLOCK
Defined in BIP37.
Definition: protocol.h:481
serviceFlagsToStr
std::vector< std::string > serviceFlagsToStr(const uint64_t flags)
Convert service flags (a bitmask of NODE_*) to human readable strings.
Definition: protocol.cpp:280
CAddress::TIME_INIT
static constexpr uint32_t TIME_INIT
Definition: protocol.h:422
CMessageHeader::nMessageSize
uint32_t nMessageSize
Definition: protocol.h:74
flags
int flags
Definition: bitcoin-tx.cpp:532
CMessageHeader::pchMessageStart
MessageMagic pchMessageStart
Definition: protocol.h:72
uint256.h
CAddress::CAddress
CAddress()
Definition: protocol.h:425
NetMsgType::PING
const char * PING
The ping message is sent periodically to help confirm that the receiving peer is still connected.
Definition: protocol.cpp:33
NetMsgType::FILTERLOAD
const char * FILTERLOAD
The filterload message tells the receiving peer to filter all relayed transactions and requested merk...
Definition: protocol.cpp:36
GetDesirableServiceFlags
ServiceFlags GetDesirableServiceFlags(ServiceFlags services)
Gets the set of service flags which are "desirable" for a given peer.
Definition: protocol.cpp:204
NetMsgType::SENDADDRV2
const char * SENDADDRV2
The sendaddrv2 message signals support for receiving ADDRV2 messages (BIP155).
Definition: protocol.cpp:22
CAddress::CAddress
CAddress(CService ipIn, ServiceFlags nServicesIn)
Definition: protocol.h:426
MSG_TX
@ MSG_TX
Definition: protocol.h:477
ServiceFlags
ServiceFlags
nServices flags.
Definition: protocol.h:314
CMessageHeader::GetCommand
std::string GetCommand() const
Definition: protocol.cpp:112
CAddress::nServices
ServiceFlags nServices
Definition: protocol.h:464
NODE_NETWORK_LIMITED
@ NODE_NETWORK_LIMITED
Definition: protocol.h:344
CMessageHeader::MESSAGE_SIZE_SIZE
static constexpr size_t MESSAGE_SIZE_SIZE
Definition: protocol.h:41
CMessageHeader::CMessageHeader
CMessageHeader(const MessageMagic &pchMessageStartIn)
Definition: protocol.cpp:84
NODE_NETWORK
@ NODE_NETWORK
Definition: protocol.h:321
NetMsgType::CFHEADERS
const char * CFHEADERS
cfheaders is a response to a getcfheaders request containing a filter header and a vector of filter h...
Definition: protocol.cpp:48
SetServiceFlagsIBDCache
void SetServiceFlagsIBDCache(bool status)
Set the current IBD status in order to figure out the desirable service flags.
Definition: protocol.cpp:212
CInv
Inv(ventory) message data.
Definition: protocol.h:492
CustomUintFormatter
Serialization wrapper class for custom integers and enums.
Definition: serialize.h:623
NetMsgType::PONG
const char * PONG
The pong message replies to a ping message, proving to the pinging node that the ponging node is stil...
Definition: protocol.cpp:34
READWRITEAS
#define READWRITEAS(type, obj)
Definition: serialize.h:180
NODE_COMPACT_FILTERS
@ NODE_COMPACT_FILTERS
Definition: protocol.h:339
CAddress::nTime
uint32_t nTime
Definition: protocol.h:462
NetMsgType::AVAHELLO
const char * AVAHELLO
Contains a delegation and a signature.
Definition: protocol.cpp:51
version.h
MayHaveUsefulAddressDB
static bool MayHaveUsefulAddressDB(ServiceFlags services)
Checks if a peer with the given service flags may be capable of having a robust address-storage DB.
Definition: protocol.h:414
HasAllDesirableServiceFlags
static bool HasAllDesirableServiceFlags(ServiceFlags services)
A shortcut for (services & GetDesirableServiceFlags(services)) == GetDesirableServiceFlags(services),...
Definition: protocol.h:406
NetMsgType::SENDCMPCT
const char * SENDCMPCT
Contains a 1-byte bool and 8-byte LE version number.
Definition: protocol.cpp:41
NetMsgType::ADDRV2
const char * ADDRV2
The addrv2 message relays connection information for peers on the network just like the addr message,...
Definition: protocol.cpp:21
Config
Definition: config.h:17
CAddress::CAddress
CAddress(CService ipIn, ServiceFlags nServicesIn, uint32_t nTimeIn)
Definition: protocol.h:428
NetMsgType::INV
const char * INV
The inv message (inventory message) transmits one or more inventories of objects known to the transmi...
Definition: protocol.cpp:23
NetMsgType::GETHEADERS
const char * GETHEADERS
The getheaders message requests a headers message that provides block headers starting from a particu...
Definition: protocol.cpp:27
NODE_AVALANCHE
@ NODE_AVALANCHE
Definition: protocol.h:359
NetMsgType::CFILTER
const char * CFILTER
cfilter is a response to a getcfilters request containing a single compact filter.
Definition: protocol.cpp:46
NetMsgType::FEEFILTER
const char * FEEFILTER
The feefilter message tells the receiving peer not to inv us any txs which do not meet the specified ...
Definition: protocol.cpp:40
NetMsgType::HEADERS
const char * HEADERS
The headers message sends one or more block headers to a node which previously requested certain head...
Definition: protocol.cpp:29
netaddress.h
CInv::IsMsgProof
bool IsMsgProof() const
Definition: protocol.h:515
NetMsgType::GETCFCHECKPT
const char * GETCFCHECKPT
getcfcheckpt requests evenly spaced compact filter headers, enabling parallelized download and valida...
Definition: protocol.cpp:49
CMessageHeader::IsOversized
bool IsOversized(const Config &config) const
Definition: protocol.cpp:188
CMessageHeader::MESSAGE_SIZE_OFFSET
static constexpr size_t MESSAGE_SIZE_OFFSET
Definition: protocol.h:43
CInv::operator<
friend bool operator<(const CInv &a, const CInv &b)
Definition: protocol.h:502
CAddress::Init
void Init()
Using
static Wrapper< Formatter, T & > Using(T &&t)
Cause serialization/deserialization of an object to be done using a specified formatter class.
Definition: serialize.h:591
NODE_GETUTXO
@ NODE_GETUTXO
Definition: protocol.h:326
CMessageHeader::COMMAND_SIZE
static constexpr size_t COMMAND_SIZE
Definition: protocol.h:40
NODE_BLOOM
@ NODE_BLOOM
Definition: protocol.h:331
CMessageHeader::pchCommand
std::array< char, COMMAND_SIZE > pchCommand
Definition: protocol.h:73
NetMsgType::GETCFHEADERS
const char * GETCFHEADERS
getcfheaders requests a compact filter header and the filter hashes for a range of blocks,...
Definition: protocol.cpp:47
MAX_PROTOCOL_MESSAGE_LENGTH
static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH
Maximum length of incoming protocol messages (Currently 2MB).
Definition: protocol.h:28
CompactSizeFormatter
Formatter for integers in CompactSize format.
Definition: serialize.h:664
CInv::IsMsgTx
bool IsMsgTx() const
Definition: protocol.h:511
NetMsgType::FILTERCLEAR
const char * FILTERCLEAR
The filterclear message tells the receiving peer to remove a previously-set bloom filter.
Definition: protocol.cpp:38
uint256
256-bit opaque blob.
Definition: uint256.h:127
READWRITE
#define READWRITE(...)
Definition: serialize.h:179
CInv::SERIALIZE_METHODS
SERIALIZE_METHODS(CInv, obj)
Definition: protocol.h:500
NetMsgType::SENDHEADERS
const char * SENDHEADERS
Indicates that a node prefers to receive new block announcements via a "headers" message rather than ...
Definition: protocol.cpp:39
CMessageHeader::MESSAGE_START_SIZE
static constexpr size_t MESSAGE_START_SIZE
Definition: protocol.h:39
CAddress::SERIALIZE_METHODS
SERIALIZE_METHODS(CAddress, obj)
Definition: protocol.h:433
NetMsgType::GETBLOCKS
const char * GETBLOCKS
The getblocks message requests an inv message that provides block header hashes starting from a parti...
Definition: protocol.cpp:26
NetMsgType::GETDATA
const char * GETDATA
The getdata message requests one or more data objects from another node.
Definition: protocol.cpp:24
CInv::IsMsgFilteredBlk
bool IsMsgFilteredBlk() const
Definition: protocol.h:523
CInv::GetCommand
std::string GetCommand() const
Definition: protocol.cpp:216
NetMsgType::NOTFOUND
const char * NOTFOUND
The notfound message is a reply to a getdata message which requested an object the receiving node doe...
Definition: protocol.cpp:35
NODE_NONE
@ NODE_NONE
Definition: protocol.h:317
CMessageHeader::CHECKSUM_SIZE
static constexpr size_t CHECKSUM_SIZE
Definition: protocol.h:42
NetMsgType::ADDR
const char * ADDR
The addr (IP address) message relays connection information for peers on the network.
Definition: protocol.cpp:20
NetMsgType::BLOCK
const char * BLOCK
The block message transmits a single serialized block.
Definition: protocol.cpp:30
CMessageHeader::IsValid
bool IsValid(const Config &config) const
Definition: protocol.cpp:147
MSG_AVA_PROOF
@ MSG_AVA_PROOF
Definition: protocol.h:484
SER_GETHASH
@ SER_GETHASH
Definition: serialize.h:167
NetMsgType::MEMPOOL
const char * MEMPOOL
The mempool message requests the TXIDs of transactions that the receiving node has verified as valid ...
Definition: protocol.cpp:32
CInv::CInv
CInv()
Definition: protocol.h:497
CAddress
A CService with information about it as peer.
Definition: protocol.h:421
CInv::IsMsgCmpctBlk
bool IsMsgCmpctBlk() const
Definition: protocol.h:527
CMessageHeader
Message header.
Definition: protocol.h:37
NetMsgType::TX
const char * TX
The tx message transmits a single transaction.
Definition: protocol.cpp:28
CInv::hash
uint256 hash
Definition: protocol.h:495
getAllNetMessageTypes
const std::vector< std::string > & getAllNetMessageTypes()
Get a vector of all valid message types (see above)
Definition: protocol.cpp:243
NODE_LAST_NON_EXPERIMENTAL_SERVICE_BIT
@ NODE_LAST_NON_EXPERIMENTAL_SERVICE_BIT
Definition: protocol.h:347
NetMsgType::AVARESPONSE
const char * AVARESPONSE
Contains an avalanche::Response.
Definition: protocol.cpp:53
NetMsgType::CMPCTBLOCK
const char * CMPCTBLOCK
Contains a CBlockHeaderAndShortTxIDs object - providing a header and list of "short txids".
Definition: protocol.cpp:42
CMessageHeader::SERIALIZE_METHODS
SERIALIZE_METHODS(CMessageHeader, obj)
Definition: protocol.h:67
CMessageHeader::MessageMagic
std::array< uint8_t, MESSAGE_START_SIZE > MessageMagic
Definition: protocol.h:49
MSG_TYPE_MASK
const uint32_t MSG_TYPE_MASK
getdata message type flags
Definition: protocol.h:468
CMessageHeader::HEADER_SIZE
static constexpr size_t HEADER_SIZE
Definition: protocol.h:47
SER_DISK
@ SER_DISK
Definition: serialize.h:166
GetDataMsg
GetDataMsg
getdata / inv message types.
Definition: protocol.h:475
serialize.h
NetMsgType::VERACK
const char * VERACK
The verack message acknowledges a previously-received version message, informing the connecting node ...
Definition: protocol.cpp:19
CInv::CInv
CInv(uint32_t typeIn, const uint256 &hashIn)
Definition: protocol.h:498
CInv::IsMsgBlk
bool IsMsgBlk() const
Definition: protocol.h:519
NetMsgType::AVAPROOF
const char * AVAPROOF
Contains an avalanche::Proof.
Definition: protocol.cpp:54
SER_WRITE
#define SER_WRITE(obj, code)
Definition: serialize.h:186
NetMsgType::FILTERADD
const char * FILTERADD
The filteradd message tells the receiving peer to add a single element to a previously-set bloom filt...
Definition: protocol.cpp:37
UNDEFINED
@ UNDEFINED
Definition: protocol.h:476
CInv::IsGenBlkMsg
bool IsGenBlkMsg() const
Definition: protocol.h:532
NetMsgType::GETBLOCKTXN
const char * GETBLOCKTXN
Contains a BlockTransactionsRequest Peer should respond with "blocktxn" message.
Definition: protocol.cpp:43
NetMsgType::CFCHECKPT
const char * CFCHECKPT
cfcheckpt is a response to a getcfcheckpt request containing a vector of evenly spaced filter headers...
Definition: protocol.cpp:50
SER_READ
#define SER_READ(obj, code)
Definition: serialize.h:182
MSG_CMPCT_BLOCK
@ MSG_CMPCT_BLOCK
Defined in BIP152.
Definition: protocol.h:483
NetMsgType::VERSION
const char * VERSION
The version message provides information about the transmitting node to the receiving node at the beg...
Definition: protocol.cpp:18
CMessageHeader::pchChecksum
uint8_t pchChecksum[CHECKSUM_SIZE]
Definition: protocol.h:75
CMessageHeader::IsValidWithoutConfig
bool IsValidWithoutConfig(const MessageMagic &magic) const
This is a transition method in order to stay compatible with older code that do not use the config.
Definition: protocol.cpp:171
NetMsgType::BLOCKTXN
const char * BLOCKTXN
Contains a BlockTransactions.
Definition: protocol.cpp:44
MSG_BLOCK
@ MSG_BLOCK
Definition: protocol.h:478
NetMsgType::IsBlockLike
bool IsBlockLike(const std::string &strCommand)
Indicate if the message is used to transmit the content of a block.
Definition: protocol.cpp:56
CInv::type
uint32_t type
Definition: protocol.h:494
CInv::ToString
std::string ToString() const
Definition: protocol.cpp:235
NetMsgType::GETCFILTERS
const char * GETCFILTERS
getcfilters requests compact filters for a range of blocks.
Definition: protocol.cpp:45
NetMsgType::AVAPOLL
const char * AVAPOLL
Contains an avalanche::Poll.
Definition: protocol.cpp:52
NetMsgType::GETADDR
const char * GETADDR
The getaddr message requests an addr message from the receiving node, preferably one with lots of IP ...
Definition: protocol.cpp:31
INIT_PROTO_VERSION
static const int INIT_PROTO_VERSION
initial proto version, to be increased after version/verack negotiation
Definition: version.h:14
NetMsgType::MERKLEBLOCK
const char * MERKLEBLOCK
The merkleblock message is a reply to a getdata message which requested a block using the inventory t...
Definition: protocol.cpp:25
CInv::GetKind
uint32_t GetKind() const
Definition: protocol.h:509