Disallow sending an HTLC when the balance needed is pending removal
authorMatt Corallo <git@bluematt.me>
Sun, 14 May 2023 23:34:35 +0000 (23:34 +0000)
committerMatt Corallo <git@bluematt.me>
Sun, 21 May 2023 19:05:22 +0000 (19:05 +0000)
commit2290141ed9323957ef45041b1ab1cf2776efc577
treeaefc2f86162047b632106b2636318cfbb8953869
parent6775b957bc0e738afff46eb819c69f45410f1843
Disallow sending an HTLC when the balance needed is pending removal

While its nice to be able to push an HTLC which spends balance that
is removed in our local commitment transaction but awaiting an RAA
from our peer for final removal its by no means a critical feature.

Because peers should really be sending RAAs quickly after we send
a commitment, this should be an exceedingly rare case, and we
already don't expose this as available balance when routing, so
this isn't even made available when sending, only forwarding.

Note that `test_pending_claimed_htlc_no_balance_underflow` is
removed as it tested a case which was only possible because of this
and now is no longer possible.
lightning/src/ln/channel.rs
lightning/src/ln/functional_tests.rs