From 47eb76597efb7dadb36dd98bc20bd80b2db9cd50 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 1 Sep 2014 21:36:46 +0200 Subject: [PATCH 1/2] Serializer simplifications after IMPLEMENT_SERIALIZE overhaul --- src/core.h | 7 ++--- src/main.h | 4 +-- src/netbase.h | 3 +-- src/protocol.h | 9 +++---- src/qt/recentrequeststablemodel.h | 10 +++---- src/qt/walletmodel.h | 32 ++++++++++------------ src/wallet.h | 44 +++++++++++++------------------ 7 files changed, 43 insertions(+), 66 deletions(-) diff --git a/src/core.h b/src/core.h index 34c00c414..ed37f7a3f 100644 --- a/src/core.h +++ b/src/core.h @@ -257,14 +257,12 @@ public: template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - bool fRead = ser_action.ForRead(); - READWRITE(*const_cast(&this->nVersion)); nVersion = this->nVersion; READWRITE(*const_cast*>(&vin)); READWRITE(*const_cast*>(&vout)); READWRITE(*const_cast(&nLockTime)); - if (fRead) + if (ser_action.ForRead()) UpdateHash(); } @@ -346,8 +344,7 @@ public: template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - bool fRead = ser_action.ForRead(); - if (!fRead) { + if (!ser_action.ForRead()) { uint64_t nVal = CompressAmount(txout.nValue); READWRITE(VARINT(nVal)); } else { diff --git a/src/main.h b/src/main.h index 31a1131b8..1d1a9df10 100644 --- a/src/main.h +++ b/src/main.h @@ -424,12 +424,10 @@ public: template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - bool fRead = ser_action.ForRead(); - READWRITE(nTransactions); READWRITE(vHash); std::vector vBytes; - if (fRead) { + if (ser_action.ForRead()) { READWRITE(vBytes); CPartialMerkleTree &us = *(const_cast(this)); us.vBits.resize(vBytes.size() * 8); diff --git a/src/netbase.h b/src/netbase.h index 9b52c0a41..a061a9155 100644 --- a/src/netbase.h +++ b/src/netbase.h @@ -154,11 +154,10 @@ class CService : public CNetAddr template 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); } }; 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 inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - bool fRead = ser_action.ForRead(); - - CAddress* pthis = const_cast(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); } diff --git a/src/qt/recentrequeststablemodel.h b/src/qt/recentrequeststablemodel.h index a558aa494..cdb7e47f6 100644 --- a/src/qt/recentrequeststablemodel.h +++ b/src/qt/recentrequeststablemodel.h @@ -28,19 +28,15 @@ public: template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - bool fRead = ser_action.ForRead(); - - RecentRequestEntry* pthis = const_cast(this); - unsigned int nDate = date.toTime_t(); - READWRITE(pthis->nVersion); - nVersion = pthis->nVersion; + READWRITE(this->nVersion); + nVersion = this->nVersion; READWRITE(id); READWRITE(nDate); READWRITE(recipient); - if (fRead) + if (ser_action.ForRead()) date = QDateTime::fromTime_t(nDate); } }; diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index 2a9ac4650..bd8a25bb9 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -63,20 +63,16 @@ public: template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - bool fRead = ser_action.ForRead(); - - SendCoinsRecipient* pthis = const_cast(this); - - std::string sAddress = pthis->address.toStdString(); - std::string sLabel = pthis->label.toStdString(); - std::string sMessage = pthis->message.toStdString(); + std::string sAddress = address.toStdString(); + std::string sLabel = label.toStdString(); + std::string sMessage = message.toStdString(); std::string sPaymentRequest; - if (!fRead && pthis->paymentRequest.IsInitialized()) - pthis->paymentRequest.SerializeToString(&sPaymentRequest); - std::string sAuthenticatedMerchant = pthis->authenticatedMerchant.toStdString(); + if (!ser_action.ForRead() && paymentRequest.IsInitialized()) + paymentRequest.SerializeToString(&sPaymentRequest); + std::string sAuthenticatedMerchant = authenticatedMerchant.toStdString(); - READWRITE(pthis->nVersion); - nVersion = pthis->nVersion; + READWRITE(this->nVersion); + nVersion = this->nVersion; READWRITE(sAddress); READWRITE(sLabel); READWRITE(amount); @@ -84,14 +80,14 @@ public: READWRITE(sPaymentRequest); READWRITE(sAuthenticatedMerchant); - if (fRead) + if (ser_action.ForRead()) { - pthis->address = QString::fromStdString(sAddress); - pthis->label = QString::fromStdString(sLabel); - pthis->message = QString::fromStdString(sMessage); + address = QString::fromStdString(sAddress); + label = QString::fromStdString(sLabel); + message = QString::fromStdString(sMessage); if (!sPaymentRequest.empty()) - pthis->paymentRequest.parse(QByteArray::fromRawData(sPaymentRequest.data(), sPaymentRequest.size())); - pthis->authenticatedMerchant = QString::fromStdString(sAuthenticatedMerchant); + paymentRequest.parse(QByteArray::fromRawData(sPaymentRequest.data(), sPaymentRequest.size())); + authenticatedMerchant = QString::fromStdString(sAuthenticatedMerchant); } } }; diff --git a/src/wallet.h b/src/wallet.h index cea61afed..2fc953c51 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -609,21 +609,18 @@ public: template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - bool fRead = ser_action.ForRead(); - - CWalletTx* pthis = const_cast(this); - if (fRead) - pthis->Init(NULL); + if (ser_action.ForRead()) + Init(NULL); char fSpent = false; - if (!fRead) + if (!ser_action.ForRead()) { - pthis->mapValue["fromaccount"] = pthis->strFromAccount; + mapValue["fromaccount"] = strFromAccount; - WriteOrderPos(pthis->nOrderPos, pthis->mapValue); + WriteOrderPos(nOrderPos, mapValue); if (nTimeSmart) - pthis->mapValue["timesmart"] = strprintf("%u", nTimeSmart); + mapValue["timesmart"] = strprintf("%u", nTimeSmart); } READWRITE(*(CMerkleTx*)this); @@ -636,13 +633,13 @@ public: READWRITE(fFromMe); READWRITE(fSpent); - if (fRead) + if (ser_action.ForRead()) { - pthis->strFromAccount = pthis->mapValue["fromaccount"]; + strFromAccount = mapValue["fromaccount"]; - ReadOrderPos(pthis->nOrderPos, pthis->mapValue); + ReadOrderPos(nOrderPos, mapValue); - pthis->nTimeSmart = mapValue.count("timesmart") ? (unsigned int)atoi64(pthis->mapValue["timesmart"]) : 0; + nTimeSmart = mapValue.count("timesmart") ? (unsigned int)atoi64(mapValue["timesmart"]) : 0; } mapValue.erase("fromaccount"); @@ -979,9 +976,6 @@ public: template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { - bool fRead = ser_action.ForRead(); - - CAccountingEntry& me = *const_cast(this); if (!(nType & SER_GETHASH)) READWRITE(nVersion); // Note: strAccount is serialized as part of the key, not here. @@ -989,9 +983,9 @@ public: READWRITE(nTime); READWRITE(LIMITED_STRING(strOtherAccount, 65536)); - if (!fRead) + if (!ser_action.ForRead()) { - WriteOrderPos(nOrderPos, me.mapValue); + WriteOrderPos(nOrderPos, mapValue); if (!(mapValue.empty() && _ssExtra.empty())) { @@ -999,26 +993,26 @@ public: ss.insert(ss.begin(), '\0'); ss << mapValue; ss.insert(ss.end(), _ssExtra.begin(), _ssExtra.end()); - me.strComment.append(ss.str()); + strComment.append(ss.str()); } } READWRITE(LIMITED_STRING(strComment, 65536)); size_t nSepPos = strComment.find("\0", 0, 1); - if (fRead) + if (ser_action.ForRead()) { - me.mapValue.clear(); + mapValue.clear(); if (std::string::npos != nSepPos) { CDataStream ss(std::vector(strComment.begin() + nSepPos + 1, strComment.end()), nType, nVersion); - ss >> me.mapValue; - me._ssExtra = std::vector(ss.begin(), ss.end()); + ss >> mapValue; + _ssExtra = std::vector(ss.begin(), ss.end()); } - ReadOrderPos(me.nOrderPos, me.mapValue); + ReadOrderPos(nOrderPos, mapValue); } if (std::string::npos != nSepPos) - me.strComment.erase(nSepPos); + strComment.erase(nSepPos); mapValue.erase("n"); } From 3f6540ad8f9c7b45a0dd2b260a282d3adad2406f Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 2 Sep 2014 09:58:09 +0200 Subject: [PATCH 2/2] Rename IMPLEMENT_SERIALIZE to ADD_SERIALIZE_METHODS --- src/addrman.h | 4 ++-- src/alert.h | 4 ++-- src/bloom.h | 2 +- src/core.h | 22 +++++++++++----------- src/crypter.h | 2 +- src/main.h | 14 +++++++------- src/netbase.h | 4 ++-- src/protocol.h | 6 +++--- src/qt/recentrequeststablemodel.h | 2 +- src/qt/walletmodel.h | 2 +- src/serialize.h | 6 +++--- src/wallet.h | 12 ++++++------ src/walletdb.h | 2 +- 13 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/addrman.h b/src/addrman.h index 0790802b5..90507cb45 100644 --- a/src/addrman.h +++ b/src/addrman.h @@ -46,7 +46,7 @@ private: public: - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -268,7 +268,7 @@ public: // This format is more complex, but significantly smaller (at most 1.5 MiB), and supports // changes to the ADDRMAN_ parameters without breaking the on-disk structure. // - // We don't use IMPLEMENT_SERIALIZE since the serialization and deserialization code has + // We don't use ADD_SERIALIZE_METHODS since the serialization and deserialization code has // very little in common. template void Serialize(Stream &s, int nType, int nVersionDummy) const diff --git a/src/alert.h b/src/alert.h index 4a8736d60..5ecf94cea 100644 --- a/src/alert.h +++ b/src/alert.h @@ -46,7 +46,7 @@ public: std::string strStatusBar; std::string strReserved; - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -84,7 +84,7 @@ public: SetNull(); } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { diff --git a/src/bloom.h b/src/bloom.h index 4a710928c..143e3b4c7 100644 --- a/src/bloom.h +++ b/src/bloom.h @@ -62,7 +62,7 @@ public: CBloomFilter(unsigned int nElements, double nFPRate, unsigned int nTweak, unsigned char nFlagsIn); CBloomFilter() : isFull(true), isEmpty(false), nHashFuncs(0), nTweak(0), nFlags(0) {} - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { diff --git a/src/core.h b/src/core.h index ed37f7a3f..cde8d8b3f 100644 --- a/src/core.h +++ b/src/core.h @@ -31,7 +31,7 @@ public: COutPoint() { SetNull(); } COutPoint(uint256 hashIn, uint32_t nIn) { hash = hashIn; n = nIn; } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -91,7 +91,7 @@ public: explicit CTxIn(COutPoint prevoutIn, CScript scriptSigIn=CScript(), uint32_t nSequenceIn=std::numeric_limits::max()); CTxIn(uint256 hashPrevTx, uint32_t nOut, CScript scriptSigIn=CScript(), uint32_t nSequenceIn=std::numeric_limits::max()); - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -145,7 +145,7 @@ public: friend bool operator>=(const CFeeRate& a, const CFeeRate& b) { return a.nSatoshisPerK >= b.nSatoshisPerK; } std::string ToString() const; - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -170,7 +170,7 @@ public: CTxOut(int64_t nValueIn, CScript scriptPubKeyIn); - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -253,7 +253,7 @@ public: CTransaction& operator=(const CTransaction& tx); - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -311,7 +311,7 @@ struct CMutableTransaction CMutableTransaction(); CMutableTransaction(const CTransaction& tx); - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -340,7 +340,7 @@ public: CTxOutCompressor(CTxOut &txoutIn) : txout(txoutIn) { } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -407,7 +407,7 @@ public: // undo information for all txins std::vector vprevout; - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -440,7 +440,7 @@ public: SetNull(); } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -497,7 +497,7 @@ public: *((CBlockHeader*)this) = header; } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -547,7 +547,7 @@ struct CBlockLocator vHave = vHaveIn; } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { diff --git a/src/crypter.h b/src/crypter.h index 59efc7650..c7424c9b2 100644 --- a/src/crypter.h +++ b/src/crypter.h @@ -43,7 +43,7 @@ public: // such as the various parameters to scrypt std::vector vchOtherDerivationParameters; - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { diff --git a/src/main.h b/src/main.h index 1d1a9df10..6ef16c1ed 100644 --- a/src/main.h +++ b/src/main.h @@ -197,7 +197,7 @@ struct CDiskBlockPos int nFile; unsigned int nPos; - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -230,7 +230,7 @@ struct CDiskTxPos : public CDiskBlockPos { unsigned int nTxOffset; // after header - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -313,7 +313,7 @@ class CBlockUndo public: std::vector vtxundo; // for all but the coinbase - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -420,7 +420,7 @@ protected: public: // serialization implementation - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -496,7 +496,7 @@ public: uint64_t nTimeFirst; // earliest time of block in file uint64_t nTimeLast; // latest time of block in file - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -770,7 +770,7 @@ public: hashPrev = (pprev ? pprev->GetBlockHash() : 0); } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -992,7 +992,7 @@ public: // thus the filter will likely be modified. CMerkleBlock(const CBlock& block, CBloomFilter& filter); - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { diff --git a/src/netbase.h b/src/netbase.h index a061a9155..9fc5c72eb 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 inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -150,7 +150,7 @@ 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 inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { diff --git a/src/protocol.h b/src/protocol.h index ddf096aea..82d29e66d 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 inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -85,7 +85,7 @@ class CAddress : public CService void Init(); - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -119,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 inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { diff --git a/src/qt/recentrequeststablemodel.h b/src/qt/recentrequeststablemodel.h index cdb7e47f6..3df597182 100644 --- a/src/qt/recentrequeststablemodel.h +++ b/src/qt/recentrequeststablemodel.h @@ -24,7 +24,7 @@ public: QDateTime date; SendCoinsRecipient recipient; - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index bd8a25bb9..52d02038c 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -59,7 +59,7 @@ public: static const int CURRENT_VERSION = 1; int nVersion; - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { diff --git a/src/serialize.h b/src/serialize.h index 1440676a1..dba3460d1 100644 --- a/src/serialize.h +++ b/src/serialize.h @@ -91,9 +91,9 @@ enum /* Implement three methods for serializable objects. These are actually wrappers over * "SerializationOp" template, which implements the body of each class' serialization - * code. Adding "IMPLEMENT_SERIALIZE" in the body of the class causes these wrappers to be + * code. Adding "ADD_SERIALIZE_METHODS" in the body of the class causes these wrappers to be * added as members. */ -#define IMPLEMENT_SERIALIZE \ +#define ADD_SERIALIZE_METHODS \ size_t GetSerializeSize(int nType, int nVersion) const { \ CSizeComputer s(nType, nVersion); \ NCONST_PTR(this)->SerializationOp(s, CSerActionSerialize(), nType, nVersion);\ @@ -807,7 +807,7 @@ void Unserialize(Stream& is, std::set& m, int nType, int nVersion) // -// Support for IMPLEMENT_SERIALIZE and READWRITE macro +// Support for ADD_SERIALIZE_METHODS and READWRITE macro // struct CSerActionSerialize { diff --git a/src/wallet.h b/src/wallet.h index 2fc953c51..f8e1ebac1 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -64,7 +64,7 @@ public: CKeyPool(); CKeyPool(const CPubKey& vchPubKeyIn); - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -492,7 +492,7 @@ public: fMerkleVerified = false; } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -605,7 +605,7 @@ public: nOrderPos = -1; } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -893,7 +893,7 @@ public: CWalletKey(int64_t nExpires=0); - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -929,7 +929,7 @@ public: vchPubKey = CPubKey(); } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { @@ -972,7 +972,7 @@ public: nEntryNo = 0; } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { diff --git a/src/walletdb.h b/src/walletdb.h index cf1a66216..ce63bb0b9 100644 --- a/src/walletdb.h +++ b/src/walletdb.h @@ -55,7 +55,7 @@ public: nCreateTime = nCreateTime_; } - IMPLEMENT_SERIALIZE; + ADD_SERIALIZE_METHODS; template inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {