Skip to content

Commit 0358b3a

Browse files
committed
routing: use amount to send for time lock weight
The time lock weight for a hop is supposed to be proportional to the amount that is sent/locked, but in a previous change we switched to the net amount, where inbound fees aren't yet applied. This is corrected in this commit.
1 parent b0f0715 commit 0358b3a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routing/pathfind.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ func findPath(g *graphParams, r *RestrictParams, cfg *PathFindingConfig,
823823
// weight composed of the fee that this node will charge and
824824
// the amount that will be locked for timeLockDelta blocks in
825825
// the HTLC that is handed out to fromVertex.
826-
weight := edgeWeight(netAmountToReceive, fee, timeLockDelta)
826+
weight := edgeWeight(amountToSend, fee, timeLockDelta)
827827

828828
// Compute the tentative weight to this new channel/edge
829829
// which is the weight from our toNode to the target node

0 commit comments

Comments
 (0)