MCPcopy Create free account
hub / github.com/ElementsProject/elements / CInv

Class CInv

src/protocol.h:478–511  ·  view source on GitHub ↗

inv message data */

Source from the content-addressed store, hash-verified

476
477/** inv message data */
478class CInv
479{
480public:
481 CInv();
482 CInv(uint32_t typeIn, const uint256& hashIn);
483
484 SERIALIZE_METHODS(CInv, obj) { READWRITE(obj.type, obj.hash); }
485
486 friend bool operator<(const CInv& a, const CInv& b);
487
488 std::string GetCommand() const;
489 std::string ToString() const;
490
491 // Single-message helper methods
492 bool IsMsgTx() const { return type == MSG_TX; }
493 bool IsMsgBlk() const { return type == MSG_BLOCK; }
494 bool IsMsgWtx() const { return type == MSG_WTX; }
495 bool IsMsgFilteredBlk() const { return type == MSG_FILTERED_BLOCK; }
496 bool IsMsgCmpctBlk() const { return type == MSG_CMPCT_BLOCK; }
497 bool IsMsgWitnessBlk() const { return type == MSG_WITNESS_BLOCK; }
498
499 // Combined-message helper methods
500 bool IsGenTxMsg() const
501 {
502 return type == MSG_TX || type == MSG_WTX || type == MSG_WITNESS_TX;
503 }
504 bool IsGenBlkMsg() const
505 {
506 return type == MSG_BLOCK || type == MSG_FILTERED_BLOCK || type == MSG_CMPCT_BLOCK || type == MSG_WITNESS_BLOCK;
507 }
508
509 uint32_t type;
510 uint256 hash;
511};
512
513/** Convert a TX/WITNESS_TX/WTX CInv to a GenTxid. */
514GenTxid ToGenTxid(const CInv& inv);

Callers 5

FetchBlockMethod · 0.70
ProcessGetBlockDataMethod · 0.70
ProcessHeadersMessageMethod · 0.70
ProcessMessageMethod · 0.70
SendMessagesMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected