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

@@ -154,11 +154,10 @@ class CService : public CNetAddr
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
bool fRead = ser_action.ForRead();
READWRITE(FLATDATA(ip));
unsigned short portN = htons(port);
READWRITE(portN);
if (fRead)
if (ser_action.ForRead())
port = ntohs(portN);
}
};