Skip to content

Commit

Permalink
routing: use amount to send for time lock weight
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bitromortac committed Jul 30, 2024
1 parent b0f0715 commit 0358b3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routing/pathfind.go
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ func findPath(g *graphParams, r *RestrictParams, cfg *PathFindingConfig,
// weight composed of the fee that this node will charge and
// the amount that will be locked for timeLockDelta blocks in
// the HTLC that is handed out to fromVertex.
weight := edgeWeight(netAmountToReceive, fee, timeLockDelta)
weight := edgeWeight(amountToSend, fee, timeLockDelta)

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

0 comments on commit 0358b3a

Please sign in to comment.