index: Remove unused coinstatsindex recovery code

The coinstatsindex currently looks for block data at a hash key if the prev block in CustomAppend is different than expected. This is not needed since base index should always prevent us ending up in this scenario since it should rewind the index before calling CustomAppend in this case. But even if we run into this and our belt-and-suspenders code is getting hit, the index could not recover properly from the hash key index data so it can be removed without any real impact.
This commit is contained in:
Fabian Jahr
2025-09-01 23:26:44 +02:00
parent 37c4fba1f4
commit 54dc34ec22

View File

@@ -139,16 +139,10 @@ bool CoinStatsIndex::CustomAppend(const interfaces::BlockInfo& block)
if (block.height > 0) {
uint256 expected_block_hash{*Assert(block.prev_hash)};
if (m_current_block_hash != expected_block_hash) {
LogWarning("previous block header belongs to unexpected block %s; expected %s",
LogError("previous block header belongs to unexpected block %s; expected %s",
m_current_block_hash.ToString(), expected_block_hash.ToString());
std::pair<uint256, DBVal> read_out;
if (!m_db->Read(DBHashKey(expected_block_hash), read_out)) {
LogError("previous block header not found; expected %s",
expected_block_hash.ToString());
return false;
}
}
// Add the new utxos created from the block
assert(block.data);