Do additional pre-flight checks before claiming a payment
authorMatt Corallo <git@bluematt.me>
Tue, 19 Apr 2022 21:46:44 +0000 (21:46 +0000)
committerMatt Corallo <git@bluematt.me>
Sat, 28 May 2022 00:02:49 +0000 (00:02 +0000)
commit11c2f12baaeb4fb8fcd3965eb1aaea7b8aa21722
treeee47f818efbb04c06b796ba8ad064a75e03c0d03
parent0e2542176b44519733f912de2973ed46915d2251
Do additional pre-flight checks before claiming a payment

As additional sanity checks, before claiming a payment, we check
that we have the full amount available in `claimable_htlcs` that
the payment should be for. Concretely, this prevents one
somewhat-absurd edge case where a user may receive an MPP payment,
wait many *blocks* before claiming it, allowing us to fail the
pending HTLCs and the sender to retry some subset of the payment
before we go to claim. More generally, this is just good
belt-and-suspenders against any edge cases we may have missed.
lightning/src/ln/channelmanager.rs
lightning/src/ln/functional_test_utils.rs
lightning/src/ln/functional_tests.rs