You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 236f588
Browse filesBrowse the repository at this point in the historyBrowse files
lsps-types: check the payment size against the params' limits in lsps2.buy
bLIP-52, "2. Request JIT Channel":
The LSP MUST validate that the `payment_size_msat` is within the
previous `min_payment_size_msat` and `max_payment_size_msat`
parameters from the LSP.
The service did not: a `payment_size_msat` outside the limits was
accepted as long as the opening fee was below it. Its tests
`buy_rejects_payment_below_min` and `buy_rejects_payment_above_max`
passed for other reasons (fee above the payment size, and a mock that
fails every buy with an internal error).
`OpeningFeeParams::check_payment_size()`, which `validate()` runs on
`lsps2.buy`, now rejects sizes outside the inclusive limits before
computing the fee. The spec names no error code for this; below the
minimum maps to `payment_size_too_small` (202) and above the maximum to
`payment_size_too_large` (203), as in #8948. The service tests now
check the codes and the limits themselves.
Behavior change for the service only; the client already checked the
limits before calling `lsps2.buy`.
Changelog-Fixed: lsps-plugin: the LSPS2 service now rejects `lsps2.buy` with a `payment_size_msat` outside the offered `min_payment_size_msat`/`max_payment_size_msat`.
0 commit comments