Merge #7904: txdb: Fix assert crash in new UTXO set cursor

a3310b4 txdb: Fix assert crash in new UTXO set cursor (Wladimir J. van der Laan)
This commit is contained in:
Wladimir J. van der Laan 2016-04-19 10:23:23 +02:00
commit fc9e3346e6
No known key found for this signature in database
GPG key ID: 74810B012346C9A6

View file

@ -134,12 +134,8 @@ bool CCoinsViewDBCursor::Valid() const
void CCoinsViewDBCursor::Next()
{
pcursor->Next();
if (pcursor->Valid()) {
bool ok = pcursor->GetKey(keyTmp);
assert(ok); // If GetKey fails here something must be wrong with underlying database, we cannot handle that here
} else {
if (!pcursor->Valid() || !pcursor->GetKey(keyTmp))
keyTmp.first = 0; // Invalidate cached key after last record so that Valid() and GetKey() return false
}
}
bool CBlockTreeDB::WriteBatchSync(const std::vector<std::pair<int, const CBlockFileInfo*> >& fileInfo, int nLastFile, const std::vector<const CBlockIndex*>& blockinfo) {