mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
merge bitcoin#24133: Improve robustness of coinstatsindex at restart
This commit is contained in:
parent
123cf8d2c7
commit
6f270bbf9b
@ -41,10 +41,10 @@ protected:
|
||||
DB(const fs::path& path, size_t n_cache_size,
|
||||
bool f_memory = false, bool f_wipe = false, bool f_obfuscate = false);
|
||||
|
||||
/// Read block locator of the chain that the txindex is in sync with.
|
||||
/// Read block locator of the chain that the index is in sync with.
|
||||
bool ReadBestBlock(CBlockLocator& locator) const;
|
||||
|
||||
/// Write block locator of the chain that the txindex is in sync with.
|
||||
/// Write block locator of the chain that the index is in sync with.
|
||||
void WriteBestBlock(CDBBatch& batch, const CBlockLocator& locator);
|
||||
};
|
||||
|
||||
|
@ -358,7 +358,12 @@ 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;
|
||||
|
Loading…
Reference in New Issue
Block a user