Changeset View
Changeset View
Standalone View
Standalone View
src/primitives/block.h
Show First 20 Lines • Show All 113 Lines • ▼ Show 20 Lines | struct CBlockLocator { | ||||
explicit CBlockLocator(const std::vector<uint256> &vHaveIn) | explicit CBlockLocator(const std::vector<uint256> &vHaveIn) | ||||
: vHave(vHaveIn) {} | : vHave(vHaveIn) {} | ||||
ADD_SERIALIZE_METHODS; | ADD_SERIALIZE_METHODS; | ||||
template <typename Stream, typename Operation> | template <typename Stream, typename Operation> | ||||
inline void SerializationOp(Stream &s, Operation ser_action) { | inline void SerializationOp(Stream &s, Operation ser_action) { | ||||
int nVersion = s.GetVersion(); | int nVersion = s.GetVersion(); | ||||
if (!(s.GetType() & SER_GETHASH)) READWRITE(nVersion); | if (!(s.GetType() & SER_GETHASH)) { | ||||
READWRITE(nVersion); | |||||
} | |||||
READWRITE(vHave); | READWRITE(vHave); | ||||
} | } | ||||
void SetNull() { vHave.clear(); } | void SetNull() { vHave.clear(); } | ||||
bool IsNull() const { return vHave.empty(); } | bool IsNull() const { return vHave.empty(); } | ||||
}; | }; | ||||
#endif // BITCOIN_PRIMITIVES_BLOCK_H | #endif // BITCOIN_PRIMITIVES_BLOCK_H |