From 4254cd9f8f2437a916b06db4d925ce4eff8c94b9 Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Sun, 26 Jul 2020 17:30:23 +0200 Subject: p2p: add CInv transaction message helper methods --- src/protocol.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/protocol.h') diff --git a/src/protocol.h b/src/protocol.h index d83da2034a..26e64b0009 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -430,6 +430,14 @@ public: std::string GetCommand() const; std::string ToString() const; + // Single-message helper methods + bool IsMsgTx() const { return type == MSG_TX; } + bool IsMsgWtx() const { return type == MSG_WTX; } + bool IsMsgWitnessTx() const { return type == MSG_WITNESS_TX; } + + // Combined-message helper methods + bool IsGenTxMsg() const { return type == MSG_TX || type == MSG_WTX || type == MSG_WITNESS_TX; } + int type; uint256 hash; }; -- cgit v1.2.3