mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
pay: fix handling of legacy vs tlv encoding.
As revealed by the failure of tests in #3936, where we ended up trying to send a partial payment using legacy style, we are not handling style properly. 1. BOLT9 has features, so we can *know* that the destination supports MPP. We may not have seen a node_announcement. 2. We can't assume that nodes inside routehints support TLV. 3. We can't assume direct peers support TLV. The keysend code tried to fix this up, so I'm not sure that this caused the issue in #3968, though. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Fixed: `pay` will now make reliable multi-part payments to nodes it doesn't have a node_announcement for.
This commit is contained in:
@@ -2021,6 +2021,7 @@ static struct command_result *json_paymod(struct command *cmd,
|
||||
p->json_buffer = tal_steal(p, buf);
|
||||
p->json_toks = params;
|
||||
p->destination = &b11->receiver_id;
|
||||
p->destination_has_tlv = feature_offered(b11->features, OPT_VAR_ONION);
|
||||
p->payment_hash = tal_dup(p, struct sha256, &b11->payment_hash);
|
||||
p->payment_secret = b11->payment_secret
|
||||
? tal_dup(p, struct secret, b11->payment_secret)
|
||||
|
||||
Reference in New Issue
Block a user