inv message data */
| 476 | |
| 477 | /** inv message data */ |
| 478 | class CInv |
| 479 | { |
| 480 | public: |
| 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. */ |
| 514 | GenTxid ToGenTxid(const CInv& inv); |
no outgoing calls
no test coverage detected