Skip to content

Commit

Permalink
p2p: add CInv transaction message helper methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatack committed Jul 27, 2020
1 parent 40a0481 commit 4254cd9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/protocol.h
Expand Up @@ -430,6 +430,14 @@ class CInv
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;
};
Expand Down

0 comments on commit 4254cd9

Please sign in to comment.