diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-04-19 10:23:23 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-04-19 10:23:38 +0200 |
| commit | fc9e3346e6749585f701e9d1cb59e60f1d152d06 (patch) | |
| tree | 8510e2fc0e3788c6e7ac75ca8c3a49f5bdecc9cd /src/txdb.cpp | |
| parent | Merge #7900: fix spelling mistake (diff) | |
| parent | txdb: Fix assert crash in new UTXO set cursor (diff) | |
| download | discoin-fc9e3346e6749585f701e9d1cb59e60f1d152d06.tar.xz discoin-fc9e3346e6749585f701e9d1cb59e60f1d152d06.zip | |
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)
Diffstat (limited to 'src/txdb.cpp')
| -rw-r--r-- | src/txdb.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/txdb.cpp b/src/txdb.cpp index be86cceeb..19ca17865 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) { |