Skip to content

Commit 4254cd9

Browse files
committed
p2p: add CInv transaction message helper methods
1 parent 40a0481 commit 4254cd9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/protocol.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,14 @@ class CInv
430430
std::string GetCommand() const;
431431
std::string ToString() const;
432432

433+
// Single-message helper methods
434+
bool IsMsgTx() const { return type == MSG_TX; }
435+
bool IsMsgWtx() const { return type == MSG_WTX; }
436+
bool IsMsgWitnessTx() const { return type == MSG_WITNESS_TX; }
437+
438+
// Combined-message helper methods
439+
bool IsGenTxMsg() const { return type == MSG_TX || type == MSG_WTX || type == MSG_WITNESS_TX; }
440+
433441
int type;
434442
uint256 hash;
435443
};

0 commit comments

Comments
 (0)