@@ -229,12 +229,8 @@ class CBlockIndex
229229 // ! (memory only) Sequential id assigned to distinguish order in which blocks are received.
230230 uint32_t nSequenceId{0 };
231231
232- // ! zerocoin specific fields
233- std::map<libzerocoin::CoinDenomination, int64_t > mapZerocoinSupply;
234-
235- CBlockIndex () { ClearMapZcSupply (); }
232+ CBlockIndex () {}
236233 CBlockIndex (const CBlock& block);
237- void ClearMapZcSupply ();
238234
239235 std::string ToString () const ;
240236
@@ -279,6 +275,7 @@ class CBlockIndex
279275
280276// New serialization introduced with 4.0.99
281277static const int DBI_OLD_SER_VERSION = 4009900 ;
278+ static const int DBI_SER_VERSION_NO_ZC = 4009902 ; // removes mapZerocoinSupply
282279
283280class CDiskBlockIndex : public CBlockIndex
284281{
@@ -325,7 +322,11 @@ class CDiskBlockIndex : public CBlockIndex
325322 READWRITE (nBits);
326323 READWRITE (nNonce);
327324 if (this ->nVersion > 3 ) {
328- READWRITE (mapZerocoinSupply);
325+ // zc supply removed in 4.0.99.2
326+ if (nSerVersion < DBI_SER_VERSION_NO_ZC) {
327+ std::map<libzerocoin::CoinDenomination, int64_t > mapZerocoinSupply;
328+ READWRITE (mapZerocoinSupply);
329+ }
329330 if (this ->nVersion < 7 ) READWRITE (nAccumulatorCheckpoint);
330331 }
331332
@@ -359,6 +360,7 @@ class CDiskBlockIndex : public CBlockIndex
359360 READWRITE (nBits);
360361 READWRITE (nNonce);
361362 if (this ->nVersion > 3 ) {
363+ std::map<libzerocoin::CoinDenomination, int64_t > mapZerocoinSupply;
362364 std::vector<libzerocoin::CoinDenomination> vMintDenominationsInBlock;
363365 READWRITE (nAccumulatorCheckpoint);
364366 READWRITE (mapZerocoinSupply);
0 commit comments