aboutsummaryrefslogtreecommitdiff
path: root/src/protocol.h
diff options
context:
space:
mode:
authorJon Atack <jon@atack.com>2020-07-26 17:30:23 +0200
committerJon Atack <jon@atack.com>2020-07-27 11:06:39 +0200
commit4254cd9f8f2437a916b06db4d925ce4eff8c94b9 (patch)
tree8fe4d0858f43b68d8a865b5fe10573fcd151c4da /src/protocol.h
parent40a04814d130dfc9131af3f568eb44533e2bcbfc (diff)
downloadbitcoin-4254cd9f8f2437a916b06db4d925ce4eff8c94b9.tar.xz
p2p: add CInv transaction message helper methods
Diffstat (limited to 'src/protocol.h')
-rw-r--r--src/protocol.h8
1 files changed, 8 insertions, 0 deletions
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;
};