From 4254cd9f8f2437a916b06db4d925ce4eff8c94b9 Mon Sep 17 00:00:00 2001 From: Jon Atack Date: Sun, 26 Jul 2020 17:30:23 +0200 Subject: [PATCH] p2p: add CInv transaction message helper methods --- src/protocol.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/protocol.h b/src/protocol.h index d83da2034ad..26e64b0009e 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; };