diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-04-19 10:23:23 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2016-04-19 10:23:38 +0200 |
commit | fc9e3346e6749585f701e9d1cb59e60f1d152d06 (patch) | |
tree | 8510e2fc0e3788c6e7ac75ca8c3a49f5bdecc9cd | |
parent | d28995018003db699b0b528f5e97e9002c3feeb9 (diff) | |
parent | a3310b4d485b1510c240f1db882530590b6fd7c9 (diff) |
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)
-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 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) { |