diff --git a/src/chain.h b/src/chain.h index b596ad75a..2660f6396 100644 --- a/src/chain.h +++ b/src/chain.h @@ -607,20 +607,6 @@ public: READWRITE(VARINT(nStatus)); READWRITE(VARINT(nTx)); - // These values only serialized when -zindex enabled - if((s.GetType() & SER_DISK) && fZindex) { - READWRITE(VARINT(nShieldedTx)); - READWRITE(VARINT(nShieldingTx)); - READWRITE(VARINT(nDeshieldingTx)); - READWRITE(VARINT(nFullyShieldedTx)); - - READWRITE(VARINT(nShieldedPayments)); - READWRITE(VARINT(nShieldingPayments)); - READWRITE(VARINT(nDeshieldingPayments)); - READWRITE(VARINT(nFullyShieldedPayments)); - - READWRITE(VARINT(nNotarizations)); - } if (nStatus & (BLOCK_HAVE_DATA | BLOCK_HAVE_UNDO)) READWRITE(VARINT(nFile)); @@ -668,6 +654,21 @@ public: READWRITE(nNotaryPay); READWRITE(segid); } + + // These values only serialized when -zindex enabled + if((s.GetType() & SER_DISK) && fZindex) { + READWRITE(VARINT(nShieldedTx)); + READWRITE(VARINT(nShieldingTx)); + READWRITE(VARINT(nDeshieldingTx)); + READWRITE(VARINT(nFullyShieldedTx)); + + READWRITE(VARINT(nPayments)); + READWRITE(VARINT(nNotarizations)); + READWRITE(VARINT(nShieldedPayments)); + READWRITE(VARINT(nShieldingPayments)); + READWRITE(VARINT(nDeshieldingPayments)); + READWRITE(VARINT(nFullyShieldedPayments)); + } } uint256 GetBlockHash() const diff --git a/src/txdb.cpp b/src/txdb.cpp index 334977f2d..c1ad0c2d0 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -692,18 +692,23 @@ bool CBlockTreeDB::LoadBlockIndexGuts() boost::scoped_ptr pcursor(NewIterator()); pcursor->Seek(make_pair(DB_BLOCK_INDEX, uint256())); + fprintf(stderr,"%s: Seeked cursor to block index\n",__FUNCTION__); // Load mapBlockIndex while (pcursor->Valid()) { + fprintf(stderr,"%s: Valid cursor\n",__FUNCTION__); boost::this_thread::interruption_point(); std::pair key; if (pcursor->GetKey(key) && key.first == DB_BLOCK_INDEX) { + fprintf(stderr,"%s: Found DB_BLOCK_INDEX\n",__FUNCTION__); CDiskBlockIndex diskindex; if (pcursor->GetValue(diskindex)) { // Construct block index object - CBlockIndex* pindexNew = InsertBlockIndex(diskindex.GetBlockHash()); + fprintf(stderr,"%s: Creating CBlockIndex...\n",__FUNCTION__); + CBlockIndex* pindexNew = InsertBlockIndex(diskindex.GetBlockHash()); pindexNew->pprev = InsertBlockIndex(diskindex.hashPrev); pindexNew->SetHeight(diskindex.GetHeight()); + fprintf(stderr,"%s: Setting CBlockIndex height...\n",__FUNCTION__); pindexNew->nFile = diskindex.nFile; pindexNew->nDataPos = diskindex.nDataPos; pindexNew->nUndoPos = diskindex.nUndoPos; @@ -720,8 +725,10 @@ bool CBlockTreeDB::LoadBlockIndexGuts() pindexNew->nTx = diskindex.nTx; pindexNew->nSproutValue = diskindex.nSproutValue; pindexNew->nSaplingValue = diskindex.nSaplingValue; + fprintf(stderr,"%s: Setting CBlockIndex details...\n",__FUNCTION__); pindexNew->segid = diskindex.segid; pindexNew->nNotaryPay = diskindex.nNotaryPay; + pindexNew->nPayments = diskindex.nPayments; pindexNew->nShieldedTx = diskindex.nShieldedTx; pindexNew->nShieldedPayments = diskindex.nShieldedPayments; pindexNew->nShieldingTx = diskindex.nShieldingTx;