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:
Rusty Russell
2020-09-10 15:09:04 +09:30
parent 9587425f2d
commit 191355e0e7
4 changed files with 15 additions and 14 deletions

View File

@@ -169,6 +169,8 @@ struct payment {
/* Real destination we want to route to */
struct node_id *destination;
/* Do we know for sure that this supports OPT_VAR_ONION? */
bool destination_has_tlv;
/* Payment hash extracted from the invoice if any. */
struct sha256 *payment_hash;