Andrew Toth 2ee7f9b259
coins: assume GetCoin only returns unspent coins
`CCoinsViewCache::FetchCoin()` had special handling for a spent `Coin` returned by the parent view.
Production parents (`CCoinsViewCache` and `CCoinsViewDB`) do not return spent coins, so this path is unreachable.

Replace it with an `Assume(!coin.IsSpent())`, drop outdated documentation about spent+FRESH cache entries, and simplify `SanityCheck()` to assert the remaining possible state invariants.
This is safe because it does not change behavior for valid backends and will fail fast if the `GetCoin()` contract is violated.

Co-authored-by: Lőrinc <pap.lorinc@gmail.com>
2026-01-11 21:32:52 +01:00
..
2025-12-10 06:51:47 +10:00
2025-11-14 01:17:38 +02:00
2025-11-14 01:17:38 +02:00