From 0358b3a0fa0f34cecf4173eb8a0e8e969e5df9c7 Mon Sep 17 00:00:00 2001 From: bitromortac Date: Mon, 29 Jul 2024 11:12:55 +0200 Subject: [PATCH] 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. --- routing/pathfind.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routing/pathfind.go b/routing/pathfind.go index 652491763..d76c5ea22 100644 --- a/routing/pathfind.go +++ b/routing/pathfind.go @@ -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