Clean up `compute_fees` and add a saturating variant 2022-10-heap-nerdsnipe
authorMatt Corallo <git@bluematt.me>
Wed, 25 Jan 2023 17:42:20 +0000 (17:42 +0000)
committerMatt Corallo <git@bluematt.me>
Wed, 25 Jan 2023 18:58:51 +0000 (18:58 +0000)
commitbde841e928da56354d267cb329eea2ee9359e3e3
tree96ff996b716f19770aa1ba386a3f9255984edba0
parente64b5d9d2e6252954dce095989c1d55e7003299a
Clean up `compute_fees` and add a saturating variant

Often when we call `compute_fees` we really just want it to
saturate and we deal with `u64::max_value` later. In that case,
we're much better off doing the saturating in the `compute_fees` as
it can use CMOVs rather than branching at each step and then
`unwrap_or`ing at the callsite.
lightning/src/routing/router.rs