Revert unneeded changes introduced as a side-effect AuxPoW.
This commit is contained in:
parent
98b93577d2
commit
fee8930ddf
|
@ -953,7 +953,7 @@ public:
|
||||||
ReadWriteAuxPow(s, auxpow, nType, this->nVersion, ser_action);
|
ReadWriteAuxPow(s, auxpow, nType, this->nVersion, ser_action);
|
||||||
)
|
)
|
||||||
|
|
||||||
uint256 CalcBlockHash() const
|
uint256 GetBlockHash() const
|
||||||
{
|
{
|
||||||
CBlockHeader block;
|
CBlockHeader block;
|
||||||
block.nVersion = nVersion;
|
block.nVersion = nVersion;
|
||||||
|
|
16
src/txdb.cpp
16
src/txdb.cpp
|
@ -197,9 +197,8 @@ bool CBlockTreeDB::LoadBlockIndexGuts()
|
||||||
leveldb::Iterator *pcursor = NewIterator();
|
leveldb::Iterator *pcursor = NewIterator();
|
||||||
|
|
||||||
CDataStream ssKeySet(SER_DISK, CLIENT_VERSION);
|
CDataStream ssKeySet(SER_DISK, CLIENT_VERSION);
|
||||||
ssKeySet << boost::tuples::make_tuple('b', uint256(0), 'a'); // 'b' is the prefix for BlockIndex, 'a' sigifies the first part
|
|
||||||
uint256 hash;
|
uint256 hash;
|
||||||
char cType;
|
ssKeySet << boost::tuples::make_tuple('b', uint256(0), 'a'); // 'b' is the prefix for BlockIndex, 'a' sigifies the first part
|
||||||
pcursor->Seek(ssKeySet.str());
|
pcursor->Seek(ssKeySet.str());
|
||||||
|
|
||||||
// Load mapBlockIndex
|
// Load mapBlockIndex
|
||||||
|
@ -208,10 +207,11 @@ bool CBlockTreeDB::LoadBlockIndexGuts()
|
||||||
try {
|
try {
|
||||||
leveldb::Slice slKey = pcursor->key();
|
leveldb::Slice slKey = pcursor->key();
|
||||||
CDataStream ssKey(slKey.data(), slKey.data()+slKey.size(), SER_DISK, CLIENT_VERSION);
|
CDataStream ssKey(slKey.data(), slKey.data()+slKey.size(), SER_DISK, CLIENT_VERSION);
|
||||||
ssKey >> cType;
|
char chType;
|
||||||
if (cType == 'b') {
|
ssKey >> chType;
|
||||||
|
if (chType == 'b') {
|
||||||
ssKey >> hash;
|
ssKey >> hash;
|
||||||
|
|
||||||
leveldb::Slice slValue = pcursor->value();
|
leveldb::Slice slValue = pcursor->value();
|
||||||
CDataStream ssValue_immutable(slValue.data(), slValue.data()+slValue.size(), SER_DISK, CLIENT_VERSION);
|
CDataStream ssValue_immutable(slValue.data(), slValue.data()+slValue.size(), SER_DISK, CLIENT_VERSION);
|
||||||
CDiskBlockIndex diskindex;
|
CDiskBlockIndex diskindex;
|
||||||
|
@ -219,15 +219,19 @@ bool CBlockTreeDB::LoadBlockIndexGuts()
|
||||||
|
|
||||||
// Construct immutable parts of block index objecty
|
// Construct immutable parts of block index objecty
|
||||||
CBlockIndex* pindexNew = InsertBlockIndex(hash);
|
CBlockIndex* pindexNew = InsertBlockIndex(hash);
|
||||||
assert(diskindex.CalcBlockHash() == *pindexNew->phashBlock); // paranoia check
|
assert(diskindex.GetBlockHash() == *pindexNew->phashBlock); // paranoia check
|
||||||
|
|
||||||
pindexNew->pprev = InsertBlockIndex(diskindex.hashPrev);
|
pindexNew->pprev = InsertBlockIndex(diskindex.hashPrev);
|
||||||
pindexNew->nHeight = diskindex.nHeight;
|
pindexNew->nHeight = diskindex.nHeight;
|
||||||
|
pindexNew->nFile = diskindex.nFile;
|
||||||
|
pindexNew->nDataPos = diskindex.nDataPos;
|
||||||
|
pindexNew->nUndoPos = diskindex.nUndoPos;
|
||||||
pindexNew->nVersion = diskindex.nVersion;
|
pindexNew->nVersion = diskindex.nVersion;
|
||||||
pindexNew->hashMerkleRoot = diskindex.hashMerkleRoot;
|
pindexNew->hashMerkleRoot = diskindex.hashMerkleRoot;
|
||||||
pindexNew->nTime = diskindex.nTime;
|
pindexNew->nTime = diskindex.nTime;
|
||||||
pindexNew->nBits = diskindex.nBits;
|
pindexNew->nBits = diskindex.nBits;
|
||||||
pindexNew->nNonce = diskindex.nNonce;
|
pindexNew->nNonce = diskindex.nNonce;
|
||||||
|
pindexNew->nStatus = diskindex.nStatus;
|
||||||
pindexNew->nTx = diskindex.nTx;
|
pindexNew->nTx = diskindex.nTx;
|
||||||
|
|
||||||
// CheckIndex need phashBlock to be set
|
// CheckIndex need phashBlock to be set
|
||||||
|
|
Loading…
Reference in a new issue