File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -211,6 +211,11 @@ bool BaseIndex::Commit()
211211bool BaseIndex::CommitInternal (CDBBatch& batch)
212212{
213213 LOCK (cs_main);
214+ // Don't commit anything if we haven't indexed any block yet
215+ // (this could happen if init is interrupted).
216+ if (m_best_block_index == nullptr ) {
217+ return false ;
218+ }
214219 GetDB ().WriteBestBlock (batch, m_chainstate->m_chain .GetLocator (m_best_block_index));
215220 return true ;
216221}
Original file line number Diff line number Diff line change @@ -360,9 +360,9 @@ bool CoinStatsIndex::Init()
360360 if (pindex) {
361361 DBVal entry;
362362 if (!LookUpOne (*m_db, pindex, entry)) {
363- return false ;
363+ return error (" %s: Cannot read current %s state; index may be corrupted" ,
364+ __func__, GetName ());
364365 }
365-
366366 m_transaction_output_count = entry.transaction_output_count ;
367367 m_bogo_size = entry.bogo_size ;
368368 m_total_amount = entry.total_amount ;
You can’t perform that action at this time.
0 commit comments