From 2499954dbd20df07f3808d69567edd7b41f1269a Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Thu, 14 Nov 2013 15:15:47 -0200 Subject: [PATCH] proper deleting leveldb iterator fixes assertion failure --- src/txdb.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/txdb.cpp b/src/txdb.cpp index 8fae8858..572fb5ee 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -230,14 +230,17 @@ bool CBlockTreeDB::LoadBlockIndexGuts() if (pindexGenesisBlock == NULL && diskindex.GetBlockHash() == Params().HashGenesisBlock()) pindexGenesisBlock = pindexNew; - if (!pindexNew->CheckIndex()) + if (!pindexNew->CheckIndex()) { + delete pcursor; return error("LoadBlockIndex() : CheckIndex failed: %s", pindexNew->ToString().c_str()); + } pcursor->Next(); } else { break; // if shutdown requested or finished loading block index } } catch (std::exception &e) { + delete pcursor; return error("%s() : deserialize error", __PRETTY_FUNCTION__); } }