Skip to content

Commit 6ae412e

Browse files
committed
pay: Fix final TLV payload if not going through MPP modifiers
Reported-by: ZmnSCPxj Signed-off-by: Christian Decker <@cdecker> Changelog-Fixed: pay: Correct a case where we put the sub-payment value instead of the *total* value in the `total_msat` field of a multi-part payment.
1 parent fa64750 commit 6ae412e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

plugins/libplugin-pay.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,7 @@ static void payment_add_hop_onion_payload(struct payment *p,
10801080
u32 cltv = p->start_block + next->delay + 1;
10811081
u64 msat = next->amount.millisatoshis; /* Raw: TLV payload generation*/
10821082
struct tlv_field **fields;
1083+
struct payment *root = payment_root(p);
10831084
static struct short_channel_id all_zero_scid = {.u64 = 0};
10841085

10851086
/* This is the information of the node processing this payload, while
@@ -1115,8 +1116,9 @@ static void payment_add_hop_onion_payload(struct payment *p,
11151116

11161117
if (payment_secret != NULL) {
11171118
assert(final);
1118-
tlvstream_set_tlv_payload_data(fields, payment_secret,
1119-
msat);
1119+
tlvstream_set_tlv_payload_data(
1120+
fields, payment_secret,
1121+
root->amount.millisatoshis); /* Raw: TLV payload generation*/
11201122
}
11211123
break;
11221124
}

tests/test_pay.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3318,7 +3318,6 @@ def test_listpays_ongoing_attempt(node_factory, bitcoind, executor):
33183318
l1.rpc.listpays()
33193319

33203320

3321-
@pytest.mark.xfail(strict=True)
33223321
@unittest.skipIf(not DEVELOPER, "needs use_shadow")
33233322
def test_mpp_waitblockheight_routehint_conflict(node_factory, bitcoind, executor):
33243323
'''

0 commit comments

Comments
 (0)