 |
Bitcoin Core
21.99.0
P2P Digital Currency
|
Go to the documentation of this file.
7 #error This header can only be compiled as C++.
10 #ifndef BITCOIN_PROTOCOL_H
11 #define BITCOIN_PROTOCOL_H
78 extern const char*
ADDR;
95 extern const char*
INV;
120 extern const char*
TX;
130 extern const char*
BLOCK;
146 extern const char*
PING;
152 extern const char*
PONG;
368 int nVersion = s.GetVersion();
383 uint64_t services_tmp;
384 SER_WRITE(obj, services_tmp = obj.nServices);
461 #endif // BITCOIN_PROTOCOL_H
static constexpr int ADDRV2_FORMAT
A flag that is ORed into the protocol version to designate that addresses should be serialized in (un...
A combination of a network address (CNetAddr) and a (TCP) port.
bool IsMsgWitnessBlk() const
Bitcoin protocol message types.
static constexpr uint32_t TIME_INIT
A generic txid reference (txid or wtxid).
@ MSG_FILTERED_BLOCK
Defined in BIP37.
@ MSG_CMPCT_BLOCK
Defined in BIP152.
const char * PING
The ping message is sent periodically to help confirm that the receiving peer is still connected.
const char * FILTERLOAD
The filterload message tells the receiving peer to filter all relayed transactions and requested merk...
ServiceFlags GetDesirableServiceFlags(ServiceFlags services)
Gets the set of service flags which are "desirable" for a given peer.
const char * SENDADDRV2
The sendaddrv2 message signals support for receiving ADDRV2 messages (BIP155).
CAddress(CService ipIn, ServiceFlags nServicesIn)
ServiceFlags
nServices flags
const char * CFHEADERS
cfheaders is a response to a getcfheaders request containing a filter header and a vector of filter h...
void SetServiceFlagsIBDCache(bool status)
Set the current IBD status in order to figure out the desirable service flags.
const char * PONG
The pong message replies to a ping message, proving to the pinging node that the ponging node is stil...
#define READWRITEAS(type, obj)
static bool MayHaveUsefulAddressDB(ServiceFlags services)
Checks if a peer with the given service flags may be capable of having a robust address-storage DB.
static bool HasAllDesirableServiceFlags(ServiceFlags services)
A shortcut for (services & GetDesirableServiceFlags(services)) == GetDesirableServiceFlags(services),...
const char * SENDCMPCT
Contains a 1-byte bool and 8-byte LE version number.
const char * ADDRV2
The addrv2 message relays connection information for peers on the network just like the addr message,...
CAddress(CService ipIn, ServiceFlags nServicesIn, uint32_t nTimeIn)
const char * INV
The inv message (inventory message) transmits one or more inventories of objects known to the transmi...
const char * GETHEADERS
The getheaders message requests a headers message that provides block headers starting from a particu...
const char * CFILTER
cfilter is a response to a getcfilters request containing a single compact filter.
@ MSG_WITNESS_TX
Defined in BIP144.
const char * FEEFILTER
The feefilter message tells the receiving peer not to inv us any txs which do not meet the specified ...
const char * HEADERS
The headers message sends one or more block headers to a node which previously requested certain head...
const char * GETCFCHECKPT
getcfcheckpt requests evenly spaced compact filter headers, enabling parallelized download and valida...
friend bool operator<(const CInv &a, const CInv &b)
const char * WTXIDRELAY
Indicates that a node prefers to relay transactions via wtxid, rather than txid.
const char * GETCFHEADERS
getcfheaders requests a compact filter header and the filter hashes for a range of blocks,...
const char * FILTERCLEAR
The filterclear message tells the receiving peer to remove a previously-set bloom filter.
SERIALIZE_METHODS(CInv, obj)
const char * SENDHEADERS
Indicates that a node prefers to receive new block announcements via a "headers" message rather than ...
SERIALIZE_METHODS(CAddress, obj)
const char * GETBLOCKS
The getblocks message requests an inv message that provides block header hashes starting from a parti...
const char * GETDATA
The getdata message requests one or more data objects from another node.
bool IsMsgFilteredBlk() const
std::string GetCommand() const
const char * NOTFOUND
The notfound message is a reply to a getdata message which requested an object the receiving node doe...
const char * ADDR
The addr (IP address) message relays connection information for peers on the network.
const char * BLOCK
The block message transmits a single serialized block.
const char * MEMPOOL
The mempool message requests the TXIDs of transactions that the receiving node has verified as valid ...
A CService with information about it as peer.
bool IsMsgCmpctBlk() const
const char * TX
The tx message transmits a single transaction.
const std::vector< std::string > & getAllNetMessageTypes()
@ MSG_WTX
Defined in BIP 339.
const char * CMPCTBLOCK
Contains a CBlockHeaderAndShortTxIDs object - providing a header and list of "short txids".
const uint32_t MSG_TYPE_MASK
const char * VERACK
The verack message acknowledges a previously-received version message, informing the connecting node ...
#define SER_WRITE(obj, code)
const char * FILTERADD
The filteradd message tells the receiving peer to add a single element to a previously-set bloom filt...
const char * GETBLOCKTXN
Contains a BlockTransactionsRequest Peer should respond with "blocktxn" message.
std::vector< std::string > serviceFlagsToStr(uint64_t flags)
Convert service flags (a bitmask of NODE_*) to human readable strings.
const char * CFCHECKPT
cfcheckpt is a response to a getcfcheckpt request containing a vector of evenly spaced filter headers...
#define SER_READ(obj, code)
const char * VERSION
The version message provides information about the transmitting node to the receiving node at the beg...
static Wrapper< Formatter, T & > Using(T &&t)
Cause serialization/deserialization of an object to be done using a specified formatter class.
GenTxid ToGenTxid(const CInv &inv)
Convert a TX/WITNESS_TX/WTX CInv to a GenTxid.
const char * BLOCKTXN
Contains a BlockTransactions.
@ MSG_WITNESS_BLOCK
Defined in BIP144.
std::string ToString() const
const uint32_t MSG_WITNESS_FLAG
getdata message type flags
const char * GETCFILTERS
getcfilters requests compact filters for a range of blocks.
const char * GETADDR
The getaddr message requests an addr message from the receiving node, preferably one with lots of IP ...
static const int INIT_PROTO_VERSION
initial proto version, to be increased after version/verack negotiation
const char * MERKLEBLOCK
The merkleblock message is a reply to a getdata message which requested a block using the inventory t...
GetDataMsg
getdata / inv message types.