Bitcoin Core  22.99.0
P2P Digital Currency
protocol.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2020 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 <primitives/transaction.h>
15 #include <serialize.h>
16 #include <streams.h>
17 #include <uint256.h>
18 #include <version.h>
19 
20 #include <limits>
21 #include <stdint.h>
22 #include <string>
23 
31 {
32 public:
33  static constexpr size_t MESSAGE_START_SIZE = 4;
34  static constexpr size_t COMMAND_SIZE = 12;
35  static constexpr size_t MESSAGE_SIZE_SIZE = 4;
36  static constexpr size_t CHECKSUM_SIZE = 4;
40  typedef unsigned char MessageStartChars[MESSAGE_START_SIZE];
41 
42  explicit CMessageHeader() = default;
43 
47  CMessageHeader(const MessageStartChars& pchMessageStartIn, const char* pszCommand, unsigned int nMessageSizeIn);
48 
49  std::string GetCommand() const;
50  bool IsCommandValid() const;
51 
52  SERIALIZE_METHODS(CMessageHeader, obj) { READWRITE(obj.pchMessageStart, obj.pchCommand, obj.nMessageSize, obj.pchChecksum); }
53 
56  uint32_t nMessageSize{std::numeric_limits<uint32_t>::max()};
58 };
59 
64 namespace NetMsgType {
65 
70 extern const char* VERSION;
75 extern const char* VERACK;
80 extern const char* ADDR;
86 extern const char *ADDRV2;
92 extern const char *SENDADDRV2;
97 extern const char* INV;
101 extern const char* GETDATA;
107 extern const char* MERKLEBLOCK;
112 extern const char* GETBLOCKS;
118 extern const char* GETHEADERS;
122 extern const char* TX;
128 extern const char* HEADERS;
132 extern const char* BLOCK;
137 extern const char* GETADDR;
143 extern const char* MEMPOOL;
148 extern const char* PING;
154 extern const char* PONG;
160 extern const char* NOTFOUND;
168 extern const char* FILTERLOAD;
176 extern const char* FILTERADD;
184 extern const char* FILTERCLEAR;
190 extern const char* SENDHEADERS;
196 extern const char* FEEFILTER;
204 extern const char* SENDCMPCT;
210 extern const char* CMPCTBLOCK;
216 extern const char* GETBLOCKTXN;
222 extern const char* BLOCKTXN;
228 extern const char* GETCFILTERS;
233 extern const char* CFILTER;
241 extern const char* GETCFHEADERS;
246 extern const char* CFHEADERS;
253 extern const char* GETCFCHECKPT;
258 extern const char* CFCHECKPT;
264 extern const char* WTXIDRELAY;
265 }; // namespace NetMsgType
266 
267 /* Get a vector of all valid message types (see above) */
268 const std::vector<std::string>& getAllNetMessageTypes();
269 
271 enum ServiceFlags : uint64_t {
272  // NOTE: When adding here, be sure to update serviceFlagToStr too
273  // Nothing
275  // NODE_NETWORK means that the node is capable of serving the complete block chain. It is currently
276  // set by all Bitcoin Core non pruned nodes, and is unset by SPV clients or other light clients.
277  NODE_NETWORK = (1 << 0),
278  // NODE_BLOOM means the node is capable and willing to handle bloom-filtered connections.
279  // Bitcoin Core nodes used to support this by default, without advertising this bit,
280  // but no longer do as of protocol version 70011 (= NO_BLOOM_VERSION)
281  NODE_BLOOM = (1 << 2),
282  // NODE_WITNESS indicates that a node can be asked for blocks and transactions including
283  // witness data.
284  NODE_WITNESS = (1 << 3),
285  // NODE_COMPACT_FILTERS means the node will service basic block filter requests.
286  // See BIP157 and BIP158 for details on how this is implemented.
288  // NODE_NETWORK_LIMITED means the same as NODE_NETWORK with the limitation of only
289  // serving the last 288 (2 day) blocks
290  // See BIP159 for details on how this is implemented.
291  NODE_NETWORK_LIMITED = (1 << 10),
292 
293  // Bits 24-31 are reserved for temporary experiments. Just pick a bit that
294  // isn't getting used, or one not being used much, and notify the
295  // bitcoin-development mailing list. Remember that service bits are just
296  // unauthenticated advertisements, so your code must be robust against
297  // collisions and other cases where nodes may be advertising a service they
298  // do not actually support. Other service bits should be allocated via the
299  // BIP process.
300 };
301 
307 std::vector<std::string> serviceFlagsToStr(uint64_t flags);
308 
334 
336 void SetServiceFlagsIBDCache(bool status);
337 
343 static inline bool HasAllDesirableServiceFlags(ServiceFlags services)
344 {
345  return !(GetDesirableServiceFlags(services) & (~services));
346 }
347 
352 static inline bool MayHaveUsefulAddressDB(ServiceFlags services)
353 {
354  return (services & NODE_NETWORK) || (services & NODE_NETWORK_LIMITED);
355 }
356 
358 class CAddress : public CService
359 {
360  static constexpr uint32_t TIME_INIT{100000000};
361 
378  static constexpr uint32_t DISK_VERSION_INIT{220000};
379  static constexpr uint32_t DISK_VERSION_IGNORE_MASK{0b00000000'00000111'11111111'11111111};
383  static constexpr uint32_t DISK_VERSION_ADDRV2{1 << 29};
384  static_assert((DISK_VERSION_INIT & ~DISK_VERSION_IGNORE_MASK) == 0, "DISK_VERSION_INIT must be covered by DISK_VERSION_IGNORE_MASK");
385  static_assert((DISK_VERSION_ADDRV2 & DISK_VERSION_IGNORE_MASK) == 0, "DISK_VERSION_ADDRV2 must not be covered by DISK_VERSION_IGNORE_MASK");
386 
387 public:
388  CAddress() : CService{} {};
389  CAddress(CService ipIn, ServiceFlags nServicesIn) : CService{ipIn}, nServices{nServicesIn} {};
390  CAddress(CService ipIn, ServiceFlags nServicesIn, uint32_t nTimeIn) : CService{ipIn}, nTime{nTimeIn}, nServices{nServicesIn} {};
391 
392  SERIALIZE_METHODS(CAddress, obj)
393  {
394  // CAddress has a distinct network serialization and a disk serialization, but it should never
395  // be hashed (except through CHashWriter in addrdb.cpp, which sets SER_DISK), and it's
396  // ambiguous what that would mean. Make sure no code relying on that is introduced:
397  assert(!(s.GetType() & SER_GETHASH));
398  bool use_v2;
399  if (s.GetType() & SER_DISK) {
400  // In the disk serialization format, the encoding (v1 or v2) is determined by a flag version
401  // that's part of the serialization itself. ADDRV2_FORMAT in the stream version only determines
402  // whether V2 is chosen/permitted at all.
403  uint32_t stored_format_version = DISK_VERSION_INIT;
404  if (s.GetVersion() & ADDRV2_FORMAT) stored_format_version |= DISK_VERSION_ADDRV2;
405  READWRITE(stored_format_version);
406  stored_format_version &= ~DISK_VERSION_IGNORE_MASK; // ignore low bits
407  if (stored_format_version == 0) {
408  use_v2 = false;
409  } else if (stored_format_version == DISK_VERSION_ADDRV2 && (s.GetVersion() & ADDRV2_FORMAT)) {
410  // Only support v2 deserialization if ADDRV2_FORMAT is set.
411  use_v2 = true;
412  } else {
413  throw std::ios_base::failure("Unsupported CAddress disk format version");
414  }
415  } else {
416  // In the network serialization format, the encoding (v1 or v2) is determined directly by
417  // the value of ADDRV2_FORMAT in the stream version, as no explicitly encoded version
418  // exists in the stream.
419  assert(s.GetType() & SER_NETWORK);
420  use_v2 = s.GetVersion() & ADDRV2_FORMAT;
421  }
422 
423  SER_READ(obj, obj.nTime = TIME_INIT);
424  READWRITE(obj.nTime);
425  // nServices is serialized as CompactSize in V2; as uint64_t in V1.
426  if (use_v2) {
427  uint64_t services_tmp;
428  SER_WRITE(obj, services_tmp = obj.nServices);
430  SER_READ(obj, obj.nServices = static_cast<ServiceFlags>(services_tmp));
431  } else {
432  READWRITE(Using<CustomUintFormatter<8>>(obj.nServices));
433  }
434  // Invoke V1/V2 serializer for CService parent object.
435  OverrideStream<Stream> os(&s, s.GetType(), use_v2 ? ADDRV2_FORMAT : 0);
436  SerReadWriteMany(os, ser_action, ReadWriteAsHelper<CService>(obj));
437  }
438 
440  uint32_t nTime{TIME_INIT};
443 
444  friend bool operator==(const CAddress& a, const CAddress& b)
445  {
446  return a.nTime == b.nTime &&
447  a.nServices == b.nServices &&
448  static_cast<const CService&>(a) == static_cast<const CService&>(b);
449  }
450 };
451 
453 const uint32_t MSG_WITNESS_FLAG = 1 << 30;
454 const uint32_t MSG_TYPE_MASK = 0xffffffff >> 2;
455 
460 enum GetDataMsg : uint32_t {
462  MSG_TX = 1,
464  MSG_WTX = 5,
465  // The following can only occur in getdata. Invs always use TX/WTX or BLOCK.
470  // MSG_FILTERED_WITNESS_BLOCK is defined in BIP144 as reserved for future
471  // use and remains unused.
472  // MSG_FILTERED_WITNESS_BLOCK = MSG_FILTERED_BLOCK | MSG_WITNESS_FLAG,
473 };
474 
476 class CInv
477 {
478 public:
479  CInv();
480  CInv(uint32_t typeIn, const uint256& hashIn);
481 
482  SERIALIZE_METHODS(CInv, obj) { READWRITE(obj.type, obj.hash); }
483 
484  friend bool operator<(const CInv& a, const CInv& b);
485 
486  std::string GetCommand() const;
487  std::string ToString() const;
488 
489  // Single-message helper methods
490  bool IsMsgTx() const { return type == MSG_TX; }
491  bool IsMsgBlk() const { return type == MSG_BLOCK; }
492  bool IsMsgWtx() const { return type == MSG_WTX; }
493  bool IsMsgFilteredBlk() const { return type == MSG_FILTERED_BLOCK; }
494  bool IsMsgCmpctBlk() const { return type == MSG_CMPCT_BLOCK; }
495  bool IsMsgWitnessBlk() const { return type == MSG_WITNESS_BLOCK; }
496 
497  // Combined-message helper methods
498  bool IsGenTxMsg() const
499  {
500  return type == MSG_TX || type == MSG_WTX || type == MSG_WITNESS_TX;
501  }
502  bool IsGenBlkMsg() const
503  {
505  }
506 
507  uint32_t type;
509 };
510 
512 GenTxid ToGenTxid(const CInv& inv);
513 
514 #endif // BITCOIN_PROTOCOL_H
ADDRV2_FORMAT
static constexpr int ADDRV2_FORMAT
A flag that is ORed into the protocol version to designate that addresses should be serialized in (un...
Definition: netaddress.h:34
CMessageHeader::pchCommand
char pchCommand[COMMAND_SIZE]
Definition: protocol.h:55
CService
A combination of a network address (CNetAddr) and a (TCP) port.
Definition: netaddress.h:539
MSG_BLOCK
@ MSG_BLOCK
Definition: protocol.h:463
CMessageHeader::CHECKSUM_OFFSET
static constexpr size_t CHECKSUM_OFFSET
Definition: protocol.h:38
CInv::IsMsgWitnessBlk
bool IsMsgWitnessBlk() const
Definition: protocol.h:495
NetMsgType
Bitcoin protocol message types.
Definition: protocol.cpp:12
assert
assert(!tx.IsCoinBase())
SER_DISK
@ SER_DISK
Definition: serialize.h:139
CAddress::TIME_INIT
static constexpr uint32_t TIME_INIT
Definition: protocol.h:360
GenTxid
A generic txid reference (txid or wtxid).
Definition: transaction.h:390
CMessageHeader::nMessageSize
uint32_t nMessageSize
Definition: protocol.h:56
flags
int flags
Definition: bitcoin-tx.cpp:525
streams.h
transaction.h
MSG_FILTERED_BLOCK
@ MSG_FILTERED_BLOCK
Defined in BIP37.
Definition: protocol.h:466
MSG_CMPCT_BLOCK
@ MSG_CMPCT_BLOCK
Defined in BIP152.
Definition: protocol.h:467
uint256.h
NetMsgType::PING
const char * PING
The ping message is sent periodically to help confirm that the receiving peer is still connected.
Definition: protocol.cpp:28
NetMsgType::FILTERLOAD
const char * FILTERLOAD
The filterload message tells the receiving peer to filter all relayed transactions and requested merk...
Definition: protocol.cpp:31
GetDesirableServiceFlags
ServiceFlags GetDesirableServiceFlags(ServiceFlags services)
Gets the set of service flags which are "desirable" for a given peer.
Definition: protocol.cpp:127
NetMsgType::SENDADDRV2
const char * SENDADDRV2
The sendaddrv2 message signals support for receiving ADDRV2 messages (BIP155).
Definition: protocol.cpp:17
ServiceFlags
ServiceFlags
nServices flags
Definition: protocol.h:271
CMessageHeader::GetCommand
std::string GetCommand() const
Definition: protocol.cpp:102
CAddress::nServices
ServiceFlags nServices
Serialized as uint64_t in V1, and as CompactSize in V2.
Definition: protocol.h:442
NODE_NETWORK_LIMITED
@ NODE_NETWORK_LIMITED
Definition: protocol.h:291
CMessageHeader::MESSAGE_SIZE_SIZE
static constexpr size_t MESSAGE_SIZE_SIZE
Definition: protocol.h:35
NODE_NETWORK
@ NODE_NETWORK
Definition: protocol.h:277
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:43
SetServiceFlagsIBDCache
void SetServiceFlagsIBDCache(bool status)
Set the current IBD status in order to figure out the desirable service flags.
Definition: protocol.cpp:134
CInv
inv message data
Definition: protocol.h:476
CustomUintFormatter
Serialization wrapper class for custom integers and enums.
Definition: serialize.h:472
CMessageHeader::CMessageHeader
CMessageHeader()=default
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:29
CAddress::DISK_VERSION_ADDRV2
static constexpr uint32_t DISK_VERSION_ADDRV2
The version number written in disk serialized addresses to indicate V2 serializations.
Definition: protocol.h:383
NODE_COMPACT_FILTERS
@ NODE_COMPACT_FILTERS
Definition: protocol.h:287
CAddress::nTime
uint32_t nTime
Always included in serialization.
Definition: protocol.h:440
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:352
HasAllDesirableServiceFlags
static bool HasAllDesirableServiceFlags(ServiceFlags services)
A shortcut for (services & GetDesirableServiceFlags(services)) == GetDesirableServiceFlags(services),...
Definition: protocol.h:343
NetMsgType::SENDCMPCT
const char * SENDCMPCT
Contains a 1-byte bool and 8-byte LE version number.
Definition: protocol.cpp:36
CInv::IsGenTxMsg
bool IsGenTxMsg() const
Definition: protocol.h:498
NetMsgType::ADDRV2
const char * ADDRV2
The addrv2 message relays connection information for peers on the network just like the addr message,...
Definition: protocol.cpp:16
CAddress::operator==
friend bool operator==(const CAddress &a, const CAddress &b)
Definition: protocol.h:444
MSG_TX
@ MSG_TX
Definition: protocol.h:462
NetMsgType::INV
const char * INV
The inv message (inventory message) transmits one or more inventories of objects known to the transmi...
Definition: protocol.cpp:18
NetMsgType::GETHEADERS
const char * GETHEADERS
The getheaders message requests a headers message that provides block headers starting from a particu...
Definition: protocol.cpp:22
NetMsgType::CFILTER
const char * CFILTER
cfilter is a response to a getcfilters request containing a single compact filter.
Definition: protocol.cpp:41
MSG_WITNESS_TX
@ MSG_WITNESS_TX
Defined in BIP144.
Definition: protocol.h:469
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:35
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:24
netaddress.h
NetMsgType::GETCFCHECKPT
const char * GETCFCHECKPT
getcfcheckpt requests evenly spaced compact filter headers, enabling parallelized download and valida...
Definition: protocol.cpp:44
CMessageHeader::MESSAGE_SIZE_OFFSET
static constexpr size_t MESSAGE_SIZE_OFFSET
Definition: protocol.h:37
CInv::operator<
friend bool operator<(const CInv &a, const CInv &b)
Definition: protocol.cpp:146
NetMsgType::WTXIDRELAY
const char * WTXIDRELAY
Indicates that a node prefers to relay transactions via wtxid, rather than txid.
Definition: protocol.cpp:46
CMessageHeader::COMMAND_SIZE
static constexpr size_t COMMAND_SIZE
Definition: protocol.h:34
CMessageHeader::IsCommandValid
bool IsCommandValid() const
Definition: protocol.cpp:107
NODE_BLOOM
@ NODE_BLOOM
Definition: protocol.h:281
NetMsgType::GETCFHEADERS
const char * GETCFHEADERS
getcfheaders requests a compact filter header and the filter hashes for a range of blocks,...
Definition: protocol.cpp:42
CompactSizeFormatter
Formatter for integers in CompactSize format.
Definition: serialize.h:508
CInv::IsMsgTx
bool IsMsgTx() const
Definition: protocol.h:490
NetMsgType::FILTERCLEAR
const char * FILTERCLEAR
The filterclear message tells the receiving peer to remove a previously-set bloom filter.
Definition: protocol.cpp:33
uint256
256-bit opaque blob.
Definition: uint256.h:124
READWRITE
#define READWRITE(...)
Definition: serialize.h:147
CInv::SERIALIZE_METHODS
SERIALIZE_METHODS(CInv, obj)
Definition: protocol.h:482
SerReadWriteMany
void SerReadWriteMany(Stream &s, CSerActionSerialize ser_action, const Args &... args)
Definition: serialize.h:1035
NetMsgType::SENDHEADERS
const char * SENDHEADERS
Indicates that a node prefers to receive new block announcements via a "headers" message rather than ...
Definition: protocol.cpp:34
CMessageHeader::MESSAGE_START_SIZE
static constexpr size_t MESSAGE_START_SIZE
Definition: protocol.h:33
NetMsgType::GETBLOCKS
const char * GETBLOCKS
The getblocks message requests an inv message that provides block header hashes starting from a parti...
Definition: protocol.cpp:21
NetMsgType::GETDATA
const char * GETDATA
The getdata message requests one or more data objects from another node.
Definition: protocol.cpp:19
CInv::IsMsgFilteredBlk
bool IsMsgFilteredBlk() const
Definition: protocol.h:493
CInv::GetCommand
std::string GetCommand() const
Definition: protocol.cpp:151
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:30
NODE_NONE
@ NODE_NONE
Definition: protocol.h:274
CMessageHeader::CHECKSUM_SIZE
static constexpr size_t CHECKSUM_SIZE
Definition: protocol.h:36
NetMsgType::ADDR
const char * ADDR
The addr (IP address) message relays connection information for peers on the network.
Definition: protocol.cpp:15
OverrideStream
Definition: streams.h:26
NetMsgType::BLOCK
const char * BLOCK
The block message transmits a single serialized block.
Definition: protocol.cpp:25
NODE_WITNESS
@ NODE_WITNESS
Definition: protocol.h:284
NetMsgType::MEMPOOL
const char * MEMPOOL
The mempool message requests the TXIDs of transactions that the receiving node has verified as valid ...
Definition: protocol.cpp:27
CInv::CInv
CInv()
Definition: protocol.cpp:138
CAddress
A CService with information about it as peer.
Definition: protocol.h:358
CInv::IsMsgCmpctBlk
bool IsMsgCmpctBlk() const
Definition: protocol.h:494
CMessageHeader
Message header.
Definition: protocol.h:30
NetMsgType::TX
const char * TX
The tx message transmits a single transaction.
Definition: protocol.cpp:23
CInv::hash
uint256 hash
Definition: protocol.h:508
getAllNetMessageTypes
const std::vector< std::string > & getAllNetMessageTypes()
Definition: protocol.cpp:179
CAddress::DISK_VERSION_IGNORE_MASK
static constexpr uint32_t DISK_VERSION_IGNORE_MASK
Definition: protocol.h:379
MSG_WTX
@ MSG_WTX
Defined in BIP 339.
Definition: protocol.h:464
NetMsgType::CMPCTBLOCK
const char * CMPCTBLOCK
Contains a CBlockHeaderAndShortTxIDs object - providing a header and list of "short txids".
Definition: protocol.cpp:37
CMessageHeader::SERIALIZE_METHODS
SERIALIZE_METHODS(CMessageHeader, obj)
Definition: protocol.h:52
MSG_TYPE_MASK
const uint32_t MSG_TYPE_MASK
Definition: protocol.h:454
CMessageHeader::MessageStartChars
unsigned char MessageStartChars[MESSAGE_START_SIZE]
Definition: protocol.h:40
CMessageHeader::pchMessageStart
char pchMessageStart[MESSAGE_START_SIZE]
Definition: protocol.h:54
CMessageHeader::HEADER_SIZE
static constexpr size_t HEADER_SIZE
Definition: protocol.h:39
serialize.h
NetMsgType::VERACK
const char * VERACK
The verack message acknowledges a previously-received version message, informing the connecting node ...
Definition: protocol.cpp:14
SER_NETWORK
@ SER_NETWORK
Definition: serialize.h:138
CInv::IsMsgBlk
bool IsMsgBlk() const
Definition: protocol.h:491
SER_WRITE
#define SER_WRITE(obj, code)
Definition: serialize.h:150
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:32
CInv::IsGenBlkMsg
bool IsGenBlkMsg() const
Definition: protocol.h:502
NetMsgType::GETBLOCKTXN
const char * GETBLOCKTXN
Contains a BlockTransactionsRequest Peer should respond with "blocktxn" message.
Definition: protocol.cpp:38
serviceFlagsToStr
std::vector< std::string > serviceFlagsToStr(uint64_t flags)
Convert service flags (a bitmask of NODE_*) to human readable strings.
Definition: protocol.cpp:210
CInv::IsMsgWtx
bool IsMsgWtx() const
Definition: protocol.h:492
NetMsgType::CFCHECKPT
const char * CFCHECKPT
cfcheckpt is a response to a getcfcheckpt request containing a vector of evenly spaced filter headers...
Definition: protocol.cpp:45
SER_READ
#define SER_READ(obj, code)
Definition: serialize.h:149
NetMsgType::VERSION
const char * VERSION
The version message provides information about the transmitting node to the receiving node at the beg...
Definition: protocol.cpp:13
CMessageHeader::pchChecksum
uint8_t pchChecksum[CHECKSUM_SIZE]
Definition: protocol.h:57
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:440
UNDEFINED
@ UNDEFINED
Definition: protocol.h:461
ToGenTxid
GenTxid ToGenTxid(const CInv &inv)
Convert a TX/WITNESS_TX/WTX CInv to a GenTxid.
Definition: protocol.cpp:223
NetMsgType::BLOCKTXN
const char * BLOCKTXN
Contains a BlockTransactions.
Definition: protocol.cpp:39
MSG_WITNESS_BLOCK
@ MSG_WITNESS_BLOCK
Defined in BIP144.
Definition: protocol.h:468
SER_GETHASH
@ SER_GETHASH
Definition: serialize.h:140
CInv::type
uint32_t type
Definition: protocol.h:507
CInv::ToString
std::string ToString() const
Definition: protocol.cpp:170
MSG_WITNESS_FLAG
const uint32_t MSG_WITNESS_FLAG
getdata message type flags
Definition: protocol.h:453
NetMsgType::GETCFILTERS
const char * GETCFILTERS
getcfilters requests compact filters for a range of blocks.
Definition: protocol.cpp:40
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:26
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:20
GetDataMsg
GetDataMsg
getdata / inv message types.
Definition: protocol.h:460
CAddress::DISK_VERSION_INIT
static constexpr uint32_t DISK_VERSION_INIT
Historically, CAddress disk serialization stored the CLIENT_VERSION, optionally OR'ed with the ADDRV2...
Definition: protocol.h:378