Skip to content

Commit 820c03a

Browse files
committed
index: check muhash is in sync on coinstatsindex launch
1 parent 38ed58b commit 820c03a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/index/coinstatsindex.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,14 @@ bool CoinStatsIndex::Init()
363363
return error("%s: Cannot read current %s state; index may be corrupted",
364364
__func__, GetName());
365365
}
366+
367+
uint256 out;
368+
m_muhash.Finalize(out);
369+
if (entry.muhash != out) {
370+
return error("%s: Cannot read current %s state; index may be corrupted",
371+
__func__, GetName());
372+
}
373+
366374
m_transaction_output_count = entry.transaction_output_count;
367375
m_bogo_size = entry.bogo_size;
368376
m_total_amount = entry.total_amount;

0 commit comments

Comments
 (0)