aboutsummaryrefslogtreecommitdiff
path: root/src/netbase.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/netbase.h')
-rw-r--r--src/netbase.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/netbase.h b/src/netbase.h
index 9b52c0a415..9fc5c72eb8 100644
--- a/src/netbase.h
+++ b/src/netbase.h
@@ -88,7 +88,7 @@ class CNetAddr
friend bool operator!=(const CNetAddr& a, const CNetAddr& b);
friend bool operator<(const CNetAddr& a, const CNetAddr& b);
- IMPLEMENT_SERIALIZE;
+ ADD_SERIALIZE_METHODS;
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
@@ -150,15 +150,14 @@ class CService : public CNetAddr
CService(const struct in6_addr& ipv6Addr, unsigned short port);
CService(const struct sockaddr_in6& addr);
- IMPLEMENT_SERIALIZE;
+ ADD_SERIALIZE_METHODS;
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);
}
};