Skip to content

Commit

Permalink
Merge pull request qtumproject#24 from qtumproject/minsk-team/FIX-iss…
Browse files Browse the repository at this point in the history
…ue#23

Fixed (invalidateblock fails).
  • Loading branch information
qtum-neil authored Apr 4, 2017
2 parents 4a93e69 + 8f16a62 commit ea51c46
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/undo.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,29 @@ class CTxInUndo

template<typename Stream>
void Serialize(Stream &s) const {
::Serialize(s, VARINT(nHeight*2+(fCoinBase ? 1 : 0)));
/////////////////////////////////////////////////////////// // qtum
// ::Serialize(s, VARINT(nHeight*2+(fCoinBase ? 1 : 0)));
::Serialize(s, VARINT(nHeight));
::Serialize(s, fCoinBase);
::Serialize(s, fCoinStake);
///////////////////////////////////////////////////////////
if (nHeight > 0)
::Serialize(s, VARINT(this->nVersion));
::Serialize(s, CTxOutCompressor(REF(txout)));
}

template<typename Stream>
void Unserialize(Stream &s) {
unsigned int nCode = 0;
::Unserialize(s, VARINT(nCode));
nHeight = nCode / 4;
fCoinBase = nCode & 1;
fCoinStake = nCode & 2;
/////////////////////////////////////////////////////////// // qtum
// unsigned int nCode = 0;
// ::Unserialize(s, VARINT(nCode));
// nHeight = nCode / 4;
// fCoinBase = nCode & 1;
// fCoinStake = nCode & 2;
::Unserialize(s, VARINT(nHeight));
::Unserialize(s, fCoinBase);
::Unserialize(s, fCoinStake);
///////////////////////////////////////////////////////////
if (nHeight > 0)
::Unserialize(s, VARINT(this->nVersion));
::Unserialize(s, REF(CTxOutCompressor(REF(txout))));
Expand Down

0 comments on commit ea51c46

Please sign in to comment.