Changeset View
Changeset View
Standalone View
Standalone View
src/addrdb.h
Show All 26 Lines | public: | ||||
CBanEntry() { SetNull(); } | CBanEntry() { SetNull(); } | ||||
explicit CBanEntry(int64_t nCreateTimeIn) { | explicit CBanEntry(int64_t nCreateTimeIn) { | ||||
SetNull(); | SetNull(); | ||||
nCreateTime = nCreateTimeIn; | nCreateTime = nCreateTimeIn; | ||||
} | } | ||||
ADD_SERIALIZE_METHODS; | SERIALIZE_METHODS(CBanEntry, obj) { | ||||
template <typename Stream, typename Operation> | |||||
inline void SerializationOp(Stream &s, Operation ser_action) { | |||||
//! For backward compatibility | //! For backward compatibility | ||||
uint8_t ban_reason = 2; | uint8_t ban_reason = 2; | ||||
READWRITE(this->nVersion); | READWRITE(obj.nVersion, obj.nCreateTime, obj.nBanUntil, ban_reason); | ||||
READWRITE(nCreateTime); | |||||
READWRITE(nBanUntil); | |||||
READWRITE(ban_reason); | |||||
} | } | ||||
void SetNull() { | void SetNull() { | ||||
nVersion = CBanEntry::CURRENT_VERSION; | nVersion = CBanEntry::CURRENT_VERSION; | ||||
nCreateTime = 0; | nCreateTime = 0; | ||||
nBanUntil = 0; | nBanUntil = 0; | ||||
} | } | ||||
}; | }; | ||||
Show All 27 Lines |