mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-29 23:47:13 +01:00
htlcswitch: finish remainder of TestUpdateForwardingPolicy test case
In this commit, we address a lingering TODO within the TestUpdateForwardingPolicy test case to ensure that Bob will reject the payment the second time around due to an update in his fee policy.
This commit is contained in:
@@ -384,14 +384,10 @@ func generateHops(payAmt lnwire.MilliSatoshi, startingHeight uint32,
|
||||
fee := ExpectedFee(path[i].cfg.FwrdingPolicy, prevAmount)
|
||||
runningAmt += fee
|
||||
|
||||
// If the this the first hop, then we don't need to
|
||||
// apply any fee, otherwise, the amount to forward
|
||||
// needs to take into account the fees.
|
||||
if i == 0 {
|
||||
amount = prevAmount
|
||||
} else {
|
||||
amount = prevAmount + fee
|
||||
}
|
||||
// Otherwise, for a node to forward an HTLC, then
|
||||
// following inequality most hold true:
|
||||
// * amt_in - fee >= amt_to_forward
|
||||
amount = runningAmt - fee
|
||||
}
|
||||
|
||||
hops[i] = ForwardingInfo{
|
||||
|
||||
Reference in New Issue
Block a user