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.
This commit is contained in:
bitromortac 2024-07-29 11:12:55 +02:00
parent b0f0715813
commit 0358b3a0fa
No known key found for this signature in database
GPG Key ID: 1965063FC13BEBE2

View File

@ -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