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