Commit graph

3 commits

Author SHA1 Message Date
Ken Sedgwick
3c8dc3c16d
FundsMover: verify incoming amount before resolving self-payment HTLCs
The claim of a returning self-payment matched payment_hash and
payment_secret but not the HTLC amount.  Answering the hook with
resolve settles the HTLC at once, so lightningd's own
final_incorrect_htlc_amount check is skipped.  The last-hop peer
relays our onion (and thus the secret) intact but chooses the offered
amount, so it could settle a reduced HTLC, learn the preimage, and
claim the full amount upstream.

Record the intended amount at Claimer::generate() time and resolve
only an exact match; a mismatch is left to normal handling, which
fails the HTLC for lack of an invoice.

The same issue was recently fixed in sling (daywalker90/sling@835f36e8).

Fixes #322.
2026-08-11 14:56:24 -07:00
ZmnSCPxj jxPCSnmZ
06ff8e58b7 Boss/Mod/FundsMover/: Add a payment_secret to rebalances.
Fixes: #8
2020-11-16 20:35:38 +08:00
ZmnSCPxj jxPCSnmZ
5edfb39b8b Boss/Mod/FundsMover/Claimer.cpp: Sub-module of FundsMover. 2020-10-20 11:40:28 +08:00