Skip to content

Commit 5b314cd

Browse files
committed
Use onion amount amt_to_forward for MPP set calculation
If routing nodes take less fees and pay the final node more than `amt_to_forward`, the receiver may see that `total_msat` has been met before all of the sender's intended HTLCs have arrived. The receiver may then prematurely claim the payment and release the payment hash, allowing routing nodes to claim the remaining HTLCs. Using the onion value `amt_to_forward` to determine when `total_msat` has been met allows the sender to control the set total.
1 parent 8fc5383 commit 5b314cd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2108,7 +2108,7 @@ where
21082108
payment_hash,
21092109
incoming_shared_secret: shared_secret,
21102110
incoming_amt_msat: Some(amt_msat),
2111-
outgoing_amt_msat: amt_msat,
2111+
outgoing_amt_msat: hop_data.amt_to_forward,
21122112
outgoing_cltv_value: hop_data.outgoing_cltv_value,
21132113
})
21142114
}

0 commit comments

Comments
 (0)