Replace `send_htlc` amount checking with available balances
authorMatt Corallo <git@bluematt.me>
Wed, 17 May 2023 01:33:42 +0000 (01:33 +0000)
committerMatt Corallo <git@bluematt.me>
Tue, 6 Jun 2023 23:57:56 +0000 (23:57 +0000)
commit10e213cf40c5b6797e7d1a8615616f79524dbbe9
treee80401cb9c4c55aea7d0e0a7da8cda1ec282bada
parent66c4f454f0316bb8c79d53a97308c706d2d3725e
Replace `send_htlc` amount checking with available balances

Now that the `get_available_balances` min/max bounds are exact, we
can stop doing all the explicit checks in `send_htlc` entirely,
instead comparing against the `get_available_balances` bounds and
failing if the amount is out of those bounds.

This breaks support for sending amounts below the dust limit if
there is some amount of dust exposure remaining before we hit our
cap, however we will no longer generate such routes anyway.
fuzz/src/chanmon_consistency.rs
lightning/src/ln/channel.rs
lightning/src/ln/functional_tests.rs
lightning/src/ln/payment_tests.rs