MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / CInv

Class CInv

src/protocol.h:505–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

503
504/** inv message data */
505class CInv
506{
507public:
508 CInv();
509 CInv(uint32_t typeIn, const uint256& hashIn);
510
511 SERIALIZE_METHODS(CInv, obj) { READWRITE(obj.type, obj.hash); }
512
513 friend bool operator<(const CInv& a, const CInv& b);
514
515 std::string GetMessageType() const;
516 std::string ToString() const;
517
518 // Single-message helper methods
519 bool IsMsgTx() const { return type == MSG_TX; }
520 bool IsMsgBlk() const { return type == MSG_BLOCK; }
521 bool IsMsgWtx() const { return type == MSG_WTX; }
522 bool IsMsgFilteredBlk() const { return type == MSG_FILTERED_BLOCK; }
523 bool IsMsgCmpctBlk() const { return type == MSG_CMPCT_BLOCK; }
524 bool IsMsgWitnessBlk() const { return type == MSG_WITNESS_BLOCK; }
525
526 // Combined-message helper methods
527 bool IsGenTxMsg() const
528 {
529 return type == MSG_TX || type == MSG_WTX || type == MSG_WITNESS_TX;
530 }
531 bool IsGenBlkMsg() const
532 {
533 return type == MSG_BLOCK || type == MSG_FILTERED_BLOCK || type == MSG_CMPCT_BLOCK || type == MSG_WITNESS_BLOCK;
534 }
535
536 uint32_t type;
537 uint256 hash;
538};
539
540/** Convert a TX/WITNESS_TX/WTX CInv to a GenTxid. */
541GenTxid ToGenTxid(const CInv& inv);

Callers 3

FetchBlockMethod · 0.70
ProcessMessageMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected