7 #error This header can only be compiled as C++.
10 #ifndef BITCOIN_PROTOCOL_H
11 #define BITCOIN_PROTOCOL_H
50 template <
typename Stream,
typename Operation>
88 extern const char *
ADDR;
94 extern const char *
INV;
124 extern const char *
TX;
136 extern const char *
BLOCK;
155 extern const char *
PING;
162 extern const char *
PONG;
169 extern const char *
ALERT;
210 extern const char *
REJECT;
298 template <
typename Stream,
typename Operation>
301 if (ser_action.ForRead())
303 int nVersion = s.GetVersion();
307 (nVersion >= CADDR_TIME_VERSION && !(s.GetType() &
SER_GETHASH)))
353 template <
typename Stream,
typename Operation>
A CService with information about it as peer.
void SerializationOp(Stream &s, Operation ser_action)
friend bool operator<(const CInv &a, const CInv &b)
std::string ToString() const
std::string GetCommand() const
void SerializationOp(Stream &s, Operation ser_action)
A combination of a network address (CNetAddr) and a (TCP) port.
Bitcoin protocol message types.
const char * FILTERLOAD
The filterload message tells the receiving peer to filter all relayed transactions and requested merk...
const char * BLOCK
The block message transmits a single serialized block.
const char * FILTERCLEAR
The filterclear message tells the receiving peer to remove a previously-set bloom filter.
const char * HEADERS
The headers message sends one or more block headers to a node which previously requested certain head...
const char * SENDHEADERS
Indicates that a node prefers to receive new block announcements via a "headers" message rather than ...
const char * PONG
The pong message replies to a ping message, proving to the pinging node that the ponging node is stil...
const char * SENDCMPCT
Contains a 1-byte bool and 8-byte LE version number.
const char * GETADDR
The getaddr message requests an addr message from the receiving node, preferably one with lots of IP ...
const char * NOTFOUND
The notfound message is a reply to a getdata message which requested an object the receiving node doe...
const char * CMPCTBLOCK
Contains a CBlockHeaderAndShortTxIDs object - providing a header and list of "short txids".
const char * MEMPOOL
The mempool message requests the TXIDs of transactions that the receiving node has verified as valid ...
const char * TX
The tx message transmits a single transaction.
const char * FILTERADD
The filteradd message tells the receiving peer to add a single element to a previously-set bloom filt...
const char * ADDR
The addr (IP address) message relays connection information for peers on the network.
const char * VERSION
The version message provides information about the transmitting node to the receiving node at the beg...
const char * GETBLOCKS
The getblocks message requests an inv message that provides block header hashes starting from a parti...
const char * FEEFILTER
The feefilter message tells the receiving peer not to inv us any txs which do not meet the specified ...
const char * GETHEADERS
The getheaders message requests a headers message that provides block headers starting from a particu...
const char * GETDATA
The getdata message requests one or more data objects from another node.
const char * VERACK
The verack message acknowledges a previously-received version message, informing the connecting node ...
const char * BLOCKTXN
Contains a BlockTransactions.
const char * ALERT
The alert message warns nodes of problems that may affect them or the rest of the network.
const char * PING
The ping message is sent periodically to help confirm that the receiving peer is still connected.
const char * MERKLEBLOCK
The merkleblock message is a reply to a getdata message which requested a block using the inventory t...
const char * REJECT
The reject message informs the receiving node that one of its previous messages has been rejected.
const char * GETBLOCKTXN
Contains a BlockTransactionsRequest Peer should respond with "blocktxn" message.
const char * INV
The inv message (inventory message) transmits one or more inventories of objects known to the transmi...
const std::vector< std::string > & getAllNetMessageTypes()
const uint32_t MSG_WITNESS_FLAG
getdata message type flags
GetDataMsg
getdata / inv message types.
@ MSG_FILTERED_BLOCK
Defined in BIP37.
@ MSG_CMPCT_BLOCK
Defined in BIP152.
@ MSG_WITNESS_BLOCK
Defined in BIP144.
@ MSG_WITNESS_TX
Defined in BIP144.
@ MSG_FILTERED_WITNESS_BLOCK
const uint32_t MSG_TYPE_MASK
ServiceFlags
nServices flags