Skip to content

Commit 5c915db

Browse files
committed
f Only take the extra fee once, not accumulated, duh
1 parent 4bd4c7d commit 5c915db

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lightning/src/routing/router.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1267,7 +1267,12 @@ impl<'a> PaymentPath<'a> {
12671267
cur_hop_transferred_amount_msat += extra_fees_msat;
12681268
total_fee_paid_msat += extra_fees_msat;
12691269
cur_hop_fees_msat += extra_fees_msat;
1270-
extra_contribution_msat += extra_fees_msat;
1270+
1271+
// We remember and return the extra fees on the final hop to allow accounting for
1272+
// them in the path's value contribution.
1273+
if last_hop {
1274+
extra_contribution_msat = extra_fees_msat;
1275+
}
12711276
}
12721277

12731278
if last_hop {

0 commit comments

Comments
 (0)