alby-hub/swaps
Roland f4010e239a
fix: validate swap out invoice before payment (#2536)
Verify the invoice returned when creating a swap out before storing and
paying it:

- the invoice payment hash must match the payment hash of the locally
  generated preimage
- the invoice amount must not exceed the requested amount plus the
  quoted service and miner fees (with a small rounding tolerance)
- the lockup address is checked against the swap tree, matching the
  checks already performed for swap in and refunds
- the invoice is verified again directly before it is paid

Also renames AlbySwapServiceFee to AlbySwapServiceFeePercentage for
clarity.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-12 12:33:40 +07:00
..
swaps_service.go fix: validate swap out invoice before payment (#2536) 2026-08-12 12:33:40 +07:00
swaps_service_test.go fix: validate swap out invoice before payment (#2536) 2026-08-12 12:33:40 +07:00