p2p: add CInv transaction message helper methods

This commit is contained in:
Jon Atack 2020-07-26 17:30:23 +02:00
parent 40a04814d1
commit 4254cd9f8f
No known key found for this signature in database
GPG key ID: 4F5721B3D0E3921D

View file

@ -430,6 +430,14 @@ public:
std::string GetCommand() const; std::string GetCommand() const;
std::string ToString() 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; int type;
uint256 hash; uint256 hash;
}; };