From 47eb76597efb7dadb36dd98bc20bd80b2db9cd50 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 1 Sep 2014 21:36:46 +0200 Subject: Serializer simplifications after IMPLEMENT_SERIALIZE overhaul --- src/protocol.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/protocol.h') diff --git a/src/protocol.h b/src/protocol.h index e4b0991774..ddf096aeac 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -89,16 +89,13 @@ class CAddress : public CService template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - bool fRead = ser_action.ForRead(); - - CAddress* pthis = const_cast(this); - if (fRead) - pthis->Init(); + if (ser_action.ForRead()) + Init(); if (nType & SER_DISK) READWRITE(nVersion); if ((nType & SER_DISK) || (nVersion >= CADDR_TIME_VERSION && !(nType & SER_GETHASH))) - READWRITE(nTime); + READWRITE(nTime); READWRITE(nServices); READWRITE(*(CService*)this); } -- cgit v1.2.3