diff options
author | Fabian Jahr <fjahr@protonmail.com> | 2022-01-23 15:53:07 +0100 |
---|---|---|
committer | Fabian Jahr <fjahr@protonmail.com> | 2022-02-17 00:36:47 +0100 |
commit | 820c03aff5295fff68a4577aa51667198036e372 (patch) | |
tree | 24bba676ce6e518e3cca83fb47dc60926255e851 /src/index/coinstatsindex.cpp | |
parent | 38ed58b8503f2809e555036f4e98ff9b40a950c8 (diff) | |
download | bitcoin-820c03aff5295fff68a4577aa51667198036e372.tar.xz |
index: check muhash is in sync on coinstatsindex launch
Diffstat (limited to 'src/index/coinstatsindex.cpp')
-rw-r--r-- | src/index/coinstatsindex.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/index/coinstatsindex.cpp b/src/index/coinstatsindex.cpp index 7d4860b20b..a1c8a5937c 100644 --- a/src/index/coinstatsindex.cpp +++ b/src/index/coinstatsindex.cpp @@ -363,6 +363,14 @@ bool CoinStatsIndex::Init() return error("%s: Cannot read current %s state; index may be corrupted", __func__, GetName()); } + + uint256 out; + m_muhash.Finalize(out); + if (entry.muhash != out) { + return error("%s: Cannot read current %s state; index may be corrupted", + __func__, GetName()); + } + m_transaction_output_count = entry.transaction_output_count; m_bogo_size = entry.bogo_size; m_total_amount = entry.total_amount; |