mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-11 03:53:22 +02:00
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:
@@ -139,15 +139,9 @@ 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;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Add the new utxos created from the block
|
||||
|
Reference in New Issue
Block a user