mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-22 20:44:56 +00:00
proper deleting leveldb iterator fixes assertion failure
This commit is contained in:
parent
ba0b4c8613
commit
2499954dbd
@ -230,14 +230,17 @@ bool CBlockTreeDB::LoadBlockIndexGuts()
|
|||||||
if (pindexGenesisBlock == NULL && diskindex.GetBlockHash() == Params().HashGenesisBlock())
|
if (pindexGenesisBlock == NULL && diskindex.GetBlockHash() == Params().HashGenesisBlock())
|
||||||
pindexGenesisBlock = pindexNew;
|
pindexGenesisBlock = pindexNew;
|
||||||
|
|
||||||
if (!pindexNew->CheckIndex())
|
if (!pindexNew->CheckIndex()) {
|
||||||
|
delete pcursor;
|
||||||
return error("LoadBlockIndex() : CheckIndex failed: %s", pindexNew->ToString().c_str());
|
return error("LoadBlockIndex() : CheckIndex failed: %s", pindexNew->ToString().c_str());
|
||||||
|
}
|
||||||
|
|
||||||
pcursor->Next();
|
pcursor->Next();
|
||||||
} else {
|
} else {
|
||||||
break; // if shutdown requested or finished loading block index
|
break; // if shutdown requested or finished loading block index
|
||||||
}
|
}
|
||||||
} catch (std::exception &e) {
|
} catch (std::exception &e) {
|
||||||
|
delete pcursor;
|
||||||
return error("%s() : deserialize error", __PRETTY_FUNCTION__);
|
return error("%s() : deserialize error", __PRETTY_FUNCTION__);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user