Use correct min/max htlc in test util for constructing blinded pay params.
authorValentine Wallace <vwallace@protonmail.com>
Sun, 24 Dec 2023 21:47:49 +0000 (16:47 -0500)
committerValentine Wallace <vwallace@protonmail.com>
Fri, 8 Mar 2024 17:03:17 +0000 (12:03 -0500)
commite8c85bd82bb16c4990be6d1b8006b0021894f677
treecd100ab5a4fddfcbfc5a86375a1aad2fb97a13f9
parentbde5a652fa9ef4e852f69e2693b844281f83d4c9
Use correct min/max htlc in test util for constructing blinded pay params.

In testing, we use channel updates to construct blinded paths and the
{Forward,Receive}Tlvs encoded within. Given a blinded path from node A > B > C,
we currently use channel_update_A->B to construct the payment constraints for
A’s blinded payload.

This is incorrect for setting A's PaymentConstraints::htlc_minimum_msat,
because channel_update_A->B contains the minimum value that *B* will accept,
and we want the constraints to contain the min value that *A* will accept.

This never caused test failures before because min/max htlc values were always
identical in both channel directions.

Therefore, set A’s htlc min/max values to the min/max that A will accept.
lightning/src/ln/blinded_payment_tests.rs