 |
Bitcoin Core
22.99.0
P2P Digital Currency
|
Go to the documentation of this file.
18 const char *
INV=
"inv";
97 assert(pszCommand[i] == 0);
118 }
else if (*p1 < ' ' || *p1 > 0x7E) {
155 cmd.append(
"witness-");
161 case MSG_WTX:
return cmd.append(
"wtx");
166 throw std::out_of_range(
strprintf(
"CInv::GetCommand(): type=%d unknown type",
type));
174 }
catch(
const std::out_of_range &) {
191 const uint64_t service_flag = 1ULL << bit;
202 std::ostringstream stream;
203 stream.imbue(std::locale::classic());
204 stream <<
"UNKNOWN[";
205 stream <<
"2^" << bit;
212 std::vector<std::string> str_flags;
214 for (
size_t i = 0; i <
sizeof(
flags) * 8; ++i) {
215 if (
flags & (1ULL << i)) {
void SetServiceFlagsIBDCache(bool state)
Set the current IBD status in order to figure out the desirable service flags.
Bitcoin protocol message types.
A generic txid reference (txid or wtxid).
@ MSG_FILTERED_BLOCK
Defined in BIP37.
@ MSG_CMPCT_BLOCK
Defined in BIP152.
std::vector< std::string > serviceFlagsToStr(uint64_t flags)
Convert service flags (a bitmask of NODE_*) to human readable strings.
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.
static GenTxid Wtxid(const uint256 &hash)
bool operator<(const CInv &a, const CInv &b)
const char * SENDADDRV2
The sendaddrv2 message signals support for receiving ADDRV2 messages (BIP155).
ServiceFlags
nServices flags
const static std::vector< std::string > allNetMessageTypesVec(std::begin(allNetMessageTypes), std::end(allNetMessageTypes))
const char * CFHEADERS
cfheaders is a response to a getcfheaders request containing a filter header and a vector of filter h...
static GenTxid Txid(const uint256 &hash)
const char * PONG
The pong message replies to a ping message, proving to the pinging node that the ponging node is stil...
static std::string serviceFlagToStr(size_t bit)
Convert a service flag (NODE_*) to a human readable string.
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,...
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.
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...
const char * WTXIDRELAY
Indicates that a node prefers to relay transactions via wtxid, rather than txid.
size_t strnlen(const char *start, size_t max_len)
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.
std::string ToString() const
const char * SENDHEADERS
Indicates that a node prefers to receive new block announcements via a "headers" message rather than ...
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.
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.
GenTxid ToGenTxid(const CInv &inv)
Convert a TX/WITNESS_TX/WTX CInv to a GenTxid.
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.
@ 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 std::vector< std::string > & getAllNetMessageTypes()
const char * VERACK
The verack message acknowledges a previously-received version message, informing the connecting node ...
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.
const char * CFCHECKPT
cfcheckpt is a response to a getcfcheckpt request containing a vector of evenly spaced filter headers...
static std::atomic< bool > g_initial_block_download_completed(false)
const char * VERSION
The version message provides information about the transmitting node to the receiving node at the beg...
const static std::string allNetMessageTypes[]
All known message types.
const char * BLOCKTXN
Contains a BlockTransactions.
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 ...
const char * MERKLEBLOCK
The merkleblock message is a reply to a getdata message which requested a block using the inventory t...