Skip to content

Commit

Permalink
Merge #7904: txdb: Fix assert crash in new UTXO set cursor
Browse files Browse the repository at this point in the history
a3310b4 txdb: Fix assert crash in new UTXO set cursor (Wladimir J. van der Laan)
  • Loading branch information
laanwj committed Apr 19, 2016
2 parents d289950 + a3310b4 commit fc9e334
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/txdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit fc9e334

Please sign in to comment.