Bitcoin Lightning fixes this. Monero built its first layer with this assumption, and now it’s impossible to check if there has been an inflation bug like the Value Overflow Incident.
When (not if) there’s an inflation bug, the attacker will be able to sell his free XMR indefinitely.