Lőrinc b8fa6f0f70
util: introduce TrySub to prevent unsigned underflow
Introduce `TrySub(T&, U)` which subtracts an unsigned integral `U` from an unsigned integral `T`, returning `false` on underflow.
Use with `Assume(TrySub(...))` at coins cache accounting decrement sites so invariant violations fail immediately rather than silently wrapping.

Co-authored-by: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>
Co-authored-by: Pieter Wuille <pieter@wuille.net>
2026-02-23 15:56:25 +01:00
..
2026-01-15 16:15:44 +01:00
2026-01-20 16:26:50 +00:00
2026-02-02 17:22:31 +00:00
2026-01-22 12:10:33 -05:00
2024-06-11 16:28:11 +00:00