diff --git a/src/addrdb.h b/src/addrdb.h --- a/src/addrdb.h +++ b/src/addrdb.h @@ -32,16 +32,10 @@ nCreateTime = nCreateTimeIn; } - ADD_SERIALIZE_METHODS; - - template - inline void SerializationOp(Stream &s, Operation ser_action) { + SERIALIZE_METHODS(CBanEntry, obj) { //! For backward compatibility uint8_t ban_reason = 2; - READWRITE(this->nVersion); - READWRITE(nCreateTime); - READWRITE(nBanUntil); - READWRITE(ban_reason); + READWRITE(obj.nVersion, obj.nCreateTime, obj.nBanUntil, ban_reason); } void SetNull() { diff --git a/src/addrman.h b/src/addrman.h --- a/src/addrman.h +++ b/src/addrman.h @@ -56,14 +56,9 @@ friend class CAddrMan; public: - ADD_SERIALIZE_METHODS; - - template - inline void SerializationOp(Stream &s, Operation ser_action) { - READWRITEAS(CAddress, *this); - READWRITE(source); - READWRITE(nLastSuccess); - READWRITE(nAttempts); + SERIALIZE_METHODS(CAddrInfo, obj) { + READWRITEAS(CAddress, obj); + READWRITE(obj.source, obj.nLastSuccess, obj.nAttempts); } CAddrInfo(const CAddress &addrIn, const CNetAddr &addrSource) @@ -352,7 +347,7 @@ * and supports changes to the ADDRMAN_ parameters without breaking the * on-disk structure. * - * We don't use ADD_SERIALIZE_METHODS since the serialization and + * We don't use SERIALIZE_METHODS since the serialization and * deserialization code has very little in common. */ template void Serialize(Stream &s) const {