Commit graph

11 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
Ken Sedgwick
4a2ea4a039 Insert exception what() value in logging messages 2024-08-19 15:04:30 -07:00
ZmnSCPxj jxPCSnmZ
9ed661a662 Boss/Mod/FundsMover/*: Make more parsimonious about fee budget when splitting. 2021-01-05 11:32:46 +08:00
ZmnSCPxj jxPCSnmZ
46531fc8ef Boss/Mod/FundsMover/Runner.cpp: Always finish. 2020-12-04 09:33:11 +08:00
ZmnSCPxj jxPCSnmZ
a9d0ad9b18 Boss/Mod/: Use iterators instead of indexing for Jsmn::Object types.
Closes: #28
2020-11-18 16:46:20 +08: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
c9d4fc7ff6 Boss/Mod/FundsMover/Runner.cpp: Limit amount of time to run a move. 2020-11-09 11:11:49 +08:00
ZmnSCPxj jxPCSnmZ
4538cc71e0 Boss/Mod/FundsMover/Runner.cpp: Limit number of parallel running attempts. 2020-11-09 11:02:50 +08:00
ZmnSCPxj jxPCSnmZ
41bd7bc6af *: Silence clang warnings. 2020-11-02 19:02:35 +08:00
ZmnSCPxj jxPCSnmZ
0d222b4f31 Boss/Mod/FundsMover/Runner.cpp: Add missing spaces in log messages. 2020-10-27 21:15:46 +08:00
ZmnSCPxj jxPCSnmZ
e17a3caa79 Boss/Mod/FundsMover/Runner.cpp: Module to make a best-effort transfer from one channel to another. 2020-10-21 18:47:28 +08:00