Changeset View
Changeset View
Standalone View
Standalone View
src/protocol.h
| Show First 20 Lines • Show All 564 Lines • ▼ Show 20 Lines | enum GetDataMsg { | ||||
| MSG_TX = 1, | MSG_TX = 1, | ||||
| MSG_BLOCK = 2, | MSG_BLOCK = 2, | ||||
| // The following can only occur in getdata. Invs always use TX or BLOCK. | // The following can only occur in getdata. Invs always use TX or BLOCK. | ||||
| //! Defined in BIP37 | //! Defined in BIP37 | ||||
| MSG_FILTERED_BLOCK = 3, | MSG_FILTERED_BLOCK = 3, | ||||
| //! Defined in BIP152 | //! Defined in BIP152 | ||||
| MSG_CMPCT_BLOCK = 4, | MSG_CMPCT_BLOCK = 4, | ||||
| MSG_AVA_PROOF = 0x1f000001, | MSG_AVA_PROOF = 0x1f000001, | ||||
| MSG_AVA_STAKE_CONTENDER = 0x1f000002, | |||||
| }; | }; | ||||
| /** | /** | ||||
| * Inv(ventory) message data. | * Inv(ventory) message data. | ||||
| * Intended as non-ambiguous identifier of objects (eg. transactions, blocks) | * Intended as non-ambiguous identifier of objects (eg. transactions, blocks) | ||||
| * held by peers. | * held by peers. | ||||
| */ | */ | ||||
| class CInv { | class CInv { | ||||
| Show All 18 Lines | public: | ||||
| bool IsMsgTx() const { | bool IsMsgTx() const { | ||||
| auto k = GetKind(); | auto k = GetKind(); | ||||
| return k == MSG_TX; | return k == MSG_TX; | ||||
| } | } | ||||
| bool IsMsgProof() const { | bool IsMsgProof() const { | ||||
| auto k = GetKind(); | auto k = GetKind(); | ||||
| return k == MSG_AVA_PROOF; | return k == MSG_AVA_PROOF; | ||||
| } | } | ||||
| bool IsMsgStakeContender() const { | |||||
| auto k = GetKind(); | |||||
| return k == MSG_AVA_STAKE_CONTENDER; | |||||
| } | |||||
| bool IsMsgBlk() const { | bool IsMsgBlk() const { | ||||
| auto k = GetKind(); | auto k = GetKind(); | ||||
| return k == MSG_BLOCK; | return k == MSG_BLOCK; | ||||
| } | } | ||||
| bool IsMsgFilteredBlk() const { | bool IsMsgFilteredBlk() const { | ||||
| auto k = GetKind(); | auto k = GetKind(); | ||||
| return k == MSG_FILTERED_BLOCK; | return k == MSG_FILTERED_BLOCK; | ||||
| } | } | ||||
| Show All 13 Lines | |||||