Duplicated tx hash malleations always result in an invalid block, which always occurs before we store the block (association from header to txs) since it’s detected in block.check() as internal double spend. But there are two cases where we still need to know if it’s malleated. Under checkpoints, where we skip validation, we can’t trust the hash to ensure we have the block. And otherwise we want to be able to mark the header as invalid if the unmalleated block is invalid. By removing duplicates we know it’s either the right or wrong block (matches the header chain) and know whether it can be marked as invalid (because it’s the right block). Though we still would probably like to drop the peer.