aboutsummaryrefslogtreecommitdiff
path: root/src/protocol.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocol.h')
-rw-r--r--src/protocol.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/protocol.h b/src/protocol.h
index e4b0991774..82d29e66de 100644
--- a/src/protocol.h
+++ b/src/protocol.h
@@ -35,7 +35,7 @@ class CMessageHeader
std::string GetCommand() const;
bool IsValid() const;
- IMPLEMENT_SERIALIZE;
+ ADD_SERIALIZE_METHODS;
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
@@ -85,20 +85,17 @@ class CAddress : public CService
void Init();
- 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();
-
- 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);
}
@@ -122,7 +119,7 @@ class CInv
CInv(int typeIn, const uint256& hashIn);
CInv(const std::string& strType, const uint256& hashIn);
- IMPLEMENT_SERIALIZE;
+ ADD_SERIALIZE_METHODS;
template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {