11 : pchMessageStart{pchMessageStartIn}
37 }
else if (*p1 < ' ' || *p1 > 0x7E) {
62 cmd.append(
"witness-");
73 throw std::out_of_range(
strprintf(
"CInv::GetMessageType(): type=%d unknown type",
type));
81 }
catch(
const std::out_of_range &) {
93 const uint64_t service_flag = 1ULL << bit;
110 std::vector<std::string> str_flags;
112 for (
size_t i = 0; i <
sizeof(
flags) * 8; ++i) {
113 if (
flags & (1ULL << i)) {
std::string GetMessageType() const
std::string ToString() const
A generic txid reference (txid or wtxid).
static GenTxid Wtxid(const uint256 &hash)
static GenTxid Txid(const uint256 &hash)
std::string ToString() const
std::array< uint8_t, 4 > MessageStartChars
constexpr const char * CMPCTBLOCK
Contains a CBlockHeaderAndShortTxIDs object - providing a header and list of "short txids".
constexpr const char * TX
The tx message transmits a single transaction.
constexpr const char * MERKLEBLOCK
The merkleblock message is a reply to a getdata message which requested a block using the inventory t...
constexpr const char * BLOCK
The block message transmits a single serialized block.
bool operator<(const CInv &a, const CInv &b)
GenTxid ToGenTxid(const CInv &inv)
Convert a TX/WITNESS_TX/WTX CInv to a GenTxid.
std::vector< std::string > serviceFlagsToStr(uint64_t flags)
Convert service flags (a bitmask of NODE_*) to human readable strings.
static std::string serviceFlagToStr(size_t bit)
Convert a service flag (NODE_*) to a human readable string.
const uint32_t MSG_WITNESS_FLAG
getdata message type flags
const uint32_t MSG_TYPE_MASK
@ MSG_FILTERED_BLOCK
Defined in BIP37.
@ MSG_WTX
Defined in BIP 339.
@ MSG_CMPCT_BLOCK
Defined in BIP152.
ServiceFlags
nServices flags