Serializer simplifications after IMPLEMENT_SERIALIZE overhaul

This commit is contained in:
Pieter Wuille
2014-09-01 21:36:46 +02:00
parent 2e731f24b5
commit 47eb76597e
7 changed files with 43 additions and 66 deletions

View File

@@ -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);
}