aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/txdb.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/txdb.cpp b/src/txdb.cpp
index be86cceeb3..19ca178654 100644
--- a/src/txdb.cpp
+++ b/src/txdb.cpp
@@ -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) {