aboutsummaryrefslogtreecommitdiff
path: root/src/protocol.h
diff options
context:
space:
mode:
authorPieter Wuille <[email protected]>2014-09-01 21:36:46 +0200
committerPieter Wuille <[email protected]>2014-09-01 22:00:19 +0200
commit47eb76597efb7dadb36dd98bc20bd80b2db9cd50 (patch)
treeb021b10e49d0e5513b4b597c74ecba5eccff6165 /src/protocol.h
parentMerge pull request #4737 (diff)
downloaddiscoin-47eb76597efb7dadb36dd98bc20bd80b2db9cd50.tar.xz
discoin-47eb76597efb7dadb36dd98bc20bd80b2db9cd50.zip
Serializer simplifications after IMPLEMENT_SERIALIZE overhaul
Diffstat (limited to 'src/protocol.h')
-rw-r--r--src/protocol.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/protocol.h b/src/protocol.h
index e4b099177..ddf096aea 100644
--- a/src/protocol.h
+++ b/src/protocol.h
@@ -89,16 +89,13 @@ class CAddress : public CService
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
- bool fRead = ser_action.ForRead();
-
- CAddress* pthis = const_cast<CAddress*>(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);
}