mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
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.
This commit is contained in:
@@ -1076,6 +1076,7 @@ static void payment_add_hop_onion_payload(struct payment *p,
|
||||
u32 cltv = p->start_block + next->delay + 1;
|
||||
u64 msat = next->amount.millisatoshis; /* Raw: TLV payload generation*/
|
||||
struct tlv_field **fields;
|
||||
struct payment *root = payment_root(p);
|
||||
static struct short_channel_id all_zero_scid = {.u64 = 0};
|
||||
|
||||
/* This is the information of the node processing this payload, while
|
||||
@@ -1111,8 +1112,9 @@ static void payment_add_hop_onion_payload(struct payment *p,
|
||||
|
||||
if (payment_secret != NULL) {
|
||||
assert(final);
|
||||
tlvstream_set_tlv_payload_data(fields, payment_secret,
|
||||
msat);
|
||||
tlvstream_set_tlv_payload_data(
|
||||
fields, payment_secret,
|
||||
root->amount.millisatoshis); /* Raw: TLV payload generation*/
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user