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()
211
211
bool BaseIndex::CommitInternal (CDBBatch& batch)
212
212
{
213
213
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
+ }
214
219
GetDB ().WriteBestBlock (batch, m_chainstate->m_chain .GetLocator (m_best_block_index));
215
220
return true ;
216
221
}
Original file line number Diff line number Diff line change @@ -360,9 +360,9 @@ bool CoinStatsIndex::Init()
360
360
if (pindex) {
361
361
DBVal entry;
362
362
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 ());
364
365
}
365
-
366
366
m_transaction_output_count = entry.transaction_output_count ;
367
367
m_bogo_size = entry.bogo_size ;
368
368
m_total_amount = entry.total_amount ;
You can’t perform that action at this time.
0 commit comments