Changeset View
Changeset View
Standalone View
Standalone View
src/blockstatus.h
Show First 20 Lines • Show All 103 Lines • ▼ Show 20 Lines | BlockStatus withClearedFailureFlags() const { | ||||
return BlockStatus(status & ~INVALID_MASK); | return BlockStatus(status & ~INVALID_MASK); | ||||
} | } | ||||
bool isOnParkedChain() const { return status & PARKED_MASK; } | bool isOnParkedChain() const { return status & PARKED_MASK; } | ||||
BlockStatus withClearedParkedFlags() const { | BlockStatus withClearedParkedFlags() const { | ||||
return BlockStatus(status & ~PARKED_MASK); | return BlockStatus(status & ~PARKED_MASK); | ||||
} | } | ||||
ADD_SERIALIZE_METHODS; | SERIALIZE_METHODS(BlockStatus, obj) { READWRITE(VARINT(obj.status)); } | ||||
template <typename Stream, typename Operation> | |||||
inline void SerializationOp(Stream &s, Operation ser_action) { | |||||
READWRITE(VARINT(status)); | |||||
} | |||||
friend constexpr bool operator==(const BlockStatus a, const BlockStatus b) { | friend constexpr bool operator==(const BlockStatus a, const BlockStatus b) { | ||||
return a.status == b.status; | return a.status == b.status; | ||||
} | } | ||||
friend constexpr bool operator!=(const BlockStatus a, const BlockStatus b) { | friend constexpr bool operator!=(const BlockStatus a, const BlockStatus b) { | ||||
return !(a == b); | return !(a == b); | ||||
} | } | ||||
}; | }; | ||||
#endif // BITCOIN_BLOCKSTATUS_H | #endif // BITCOIN_BLOCKSTATUS_H |