diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -377,19 +377,13 @@ * a CWalletTx, but the deserialized values are discarded.**/ class CMerkleTx { public: - ADD_SERIALIZE_METHODS; - - template - inline void SerializationOp(Stream &s, Operation ser_action) { + template void Unserialize(Stream &s) { CTransactionRef tx; BlockHash hashBlock; - int nIndex = 0; - // For compatibility with older versions. std::vector vMerkleBranch; - READWRITE(tx); - READWRITE(hashBlock); - READWRITE(vMerkleBranch); - READWRITE(nIndex); + int nIndex = 0; + + s >> tx >> hashBlock >> vMerkleBranch >> nIndex; } }; @@ -505,7 +499,6 @@ int nIndex; template void Serialize(Stream &s) const { - char fSpent = false; mapValue_t mapValueCopy = mapValue; mapValueCopy["fromaccount"] = ""; @@ -515,25 +508,28 @@ } //! Used to be vMerkleBranch - std::vector dummy_vector; - s << tx << hashBlock << dummy_vector << nIndex; + std::vector dummy_vector1; //! Used to be vtxPrev - std::vector vUnused; - s << vUnused << mapValueCopy << vOrderForm << fTimeReceivedIsTxTime - << nTimeReceived << fFromMe << fSpent; + std::vector dummy_vector2; + //! Used to be fSpent + char dummy_char = false; + s << tx << hashBlock << dummy_vector1 << nIndex << dummy_vector2 + << mapValueCopy << vOrderForm << fTimeReceivedIsTxTime + << nTimeReceived << fFromMe << dummy_char; } template void Unserialize(Stream &s) { Init(nullptr); - char fSpent; //! Used to be vMerkleBranch - std::vector dummy_vector; - s >> tx >> hashBlock >> dummy_vector >> nIndex; + std::vector dummy_vector1; //! Used to be vtxPrev - std::vector vUnused; - s >> vUnused >> mapValue >> vOrderForm >> fTimeReceivedIsTxTime >> - nTimeReceived >> fFromMe >> fSpent; + std::vector dummy_vector2; + //! Used to be fSpent + char dummy_char; + s >> tx >> hashBlock >> dummy_vector1 >> nIndex >> dummy_vector2 >> + mapValue >> vOrderForm >> fTimeReceivedIsTxTime >> nTimeReceived >> + fFromMe >> dummy_char; ReadOrderPos(nOrderPos, mapValue); nTimeSmart = mapValue.count("timesmart")