Skip to content

Commit 9250a08

Browse files
committed
Convert addrdb/addrman to new serialization
1 parent ca33451 commit 9250a08

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

src/addrdb.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,7 @@ class CBanEntry
4949
banReason = ban_reason_in;
5050
}
5151

52-
ADD_SERIALIZE_METHODS;
53-
54-
template <typename Stream, typename Operation>
55-
inline void SerializationOp(Stream& s, Operation ser_action) {
56-
READWRITE(this->nVersion);
57-
READWRITE(nCreateTime);
58-
READWRITE(nBanUntil);
59-
READWRITE(banReason);
60-
}
52+
SERIALIZE_METHODS(CBanEntry, obj) { READWRITE(obj.nVersion, obj.nCreateTime, obj.nBanUntil, obj.banReason); }
6153

6254
void SetNull()
6355
{

src/addrman.h

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,10 @@ class CAddrInfo : public CAddress
5353

5454
public:
5555

56-
ADD_SERIALIZE_METHODS;
57-
58-
template <typename Stream, typename Operation>
59-
inline void SerializationOp(Stream& s, Operation ser_action) {
60-
READWRITEAS(CAddress, *this);
61-
READWRITE(source);
62-
READWRITE(nLastSuccess);
63-
READWRITE(nAttempts);
56+
SERIALIZE_METHODS(CAddrInfo, obj)
57+
{
58+
READWRITEAS(CAddress, obj);
59+
READWRITE(obj.source, obj.nLastSuccess, obj.nAttempts);
6460
}
6561

6662
CAddrInfo(const CAddress &addrIn, const CNetAddr &addrSource) : CAddress(addrIn), source(addrSource)
@@ -294,7 +290,7 @@ class CAddrMan
294290
* This format is more complex, but significantly smaller (at most 1.5 MiB), and supports
295291
* changes to the ADDRMAN_ parameters without breaking the on-disk structure.
296292
*
297-
* We don't use ADD_SERIALIZE_METHODS since the serialization and deserialization code has
293+
* We don't use SERIALIZE_METHODS since the serialization and deserialization code has
298294
* very little in common.
299295
*/
300296
template<typename Stream>

0 commit comments

Comments
 (0)