@@ -372,20 +372,16 @@ struct COutputEntry
372
372
class CMerkleTx
373
373
{
374
374
public:
375
- ADD_SERIALIZE_METHODS;
376
-
377
- template <typename Stream, typename Operation>
378
- inline void SerializationOp (Stream& s, Operation ser_action) {
375
+ template <typename Stream>
376
+ void Unserialize (Stream& s)
377
+ {
379
378
CTransactionRef tx;
380
379
uint256 hashBlock;
380
+ std::vector<uint256> vMerkleBranch;
381
381
int nIndex;
382
- std::vector<uint256> vMerkleBranch; // For compatibility with older versions.
383
- READWRITE (tx);
384
- READWRITE (hashBlock);
385
- READWRITE (vMerkleBranch);
386
- READWRITE (nIndex);
387
- }
388
382
383
+ s >> tx >> hashBlock >> vMerkleBranch >> nIndex;
384
+ }
389
385
};
390
386
391
387
// Get the marginal bytes of spending the specified output
@@ -495,7 +491,6 @@ class CWalletTx
495
491
template <typename Stream>
496
492
void Serialize (Stream& s) const
497
493
{
498
- char fSpent = false ;
499
494
mapValue_t mapValueCopy = mapValue;
500
495
501
496
mapValueCopy[" fromaccount" ] = " " ;
@@ -504,22 +499,21 @@ class CWalletTx
504
499
mapValueCopy[" timesmart" ] = strprintf (" %u" , nTimeSmart);
505
500
}
506
501
507
- std::vector<uint256> dummy_vector ; // !< Used to be vMerkleBranch
508
- s << tx << hashBlock << dummy_vector << nIndex;
509
- std::vector<CMerkleTx> vUnused ; // !< Used to be vtxPrev
510
- s << vUnused << mapValueCopy << vOrderForm << fTimeReceivedIsTxTime << nTimeReceived << fFromMe << fSpent ;
502
+ std::vector<char > dummy_vector1 ; // !< Used to be vMerkleBranch
503
+ std::vector< char > dummy_vector2; // !< Used to be vtxPrev
504
+ char dummy_char = false ; // !< Used to be fSpent
505
+ s << tx << hashBlock << dummy_vector1 << nIndex << dummy_vector2 << mapValueCopy << vOrderForm << fTimeReceivedIsTxTime << nTimeReceived << fFromMe << dummy_char ;
511
506
}
512
507
513
508
template <typename Stream>
514
509
void Unserialize (Stream& s)
515
510
{
516
511
Init (nullptr );
517
- char fSpent ;
518
512
519
- std::vector<uint256> dummy_vector ; // !< Used to be vMerkleBranch
520
- s >> tx >> hashBlock >> dummy_vector >> nIndex;
521
- std::vector<CMerkleTx> vUnused ; // !< Used to be vtxPrev
522
- s >> vUnused >> mapValue >> vOrderForm >> fTimeReceivedIsTxTime >> nTimeReceived >> fFromMe >> fSpent ;
513
+ std::vector<uint256> dummy_vector1 ; // !< Used to be vMerkleBranch
514
+ std::vector<CMerkleTx> dummy_vector2; // !< Used to be vtxPrev
515
+ char dummy_char ; // ! Used to be fSpent
516
+ s >> tx >> hashBlock >> dummy_vector1 >> nIndex >> dummy_vector2 >> mapValue >> vOrderForm >> fTimeReceivedIsTxTime >> nTimeReceived >> fFromMe >> dummy_char ;
523
517
524
518
ReadOrderPos (nOrderPos, mapValue);
525
519
nTimeSmart = mapValue.count (" timesmart" ) ? (unsigned int )atoi64 (mapValue[" timesmart" ]) : 0 ;
0 commit comments