Changeset View
Changeset View
Standalone View
Standalone View
src/protocol.h
Show First 20 Lines • Show All 522 Lines • ▼ Show 20 Lines | friend bool operator<(const CInv &a, const CInv &b) { | ||||
return a.type < b.type || (a.type == b.type && a.hash < b.hash); | return a.type < b.type || (a.type == b.type && a.hash < b.hash); | ||||
} | } | ||||
std::string GetCommand() const; | std::string GetCommand() const; | ||||
std::string ToString() const; | std::string ToString() const; | ||||
uint32_t GetKind() const { return type & MSG_TYPE_MASK; } | uint32_t GetKind() const { return type & MSG_TYPE_MASK; } | ||||
bool IsTx() const { | bool IsMsgTx() const { | ||||
auto k = GetKind(); | auto k = GetKind(); | ||||
return k == MSG_TX; | return k == MSG_TX; | ||||
} | } | ||||
bool IsSomeBlock() const { | bool IsSomeBlock() const { | ||||
auto k = GetKind(); | auto k = GetKind(); | ||||
return k == MSG_BLOCK || k == MSG_FILTERED_BLOCK || | return k == MSG_BLOCK || k == MSG_FILTERED_BLOCK || | ||||
k == MSG_CMPCT_BLOCK; | k == MSG_CMPCT_BLOCK; | ||||
} | } | ||||
}; | }; | ||||
#endif // BITCOIN_PROTOCOL_H | #endif // BITCOIN_PROTOCOL_H |