mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-10 03:24:22 +02:00
routing: return *unifiedPolicyEdge in getPolicy
We encapsulate the capacity inside a unifiedPolicyEdge for later usage. The meaning of "policy" has changed now, which will be refactored in the next commmit.
This commit is contained in:
@@ -2837,10 +2837,11 @@ func (r *ChannelRouter) BuildRoute(amt *lnwire.MilliSatoshi,
|
||||
|
||||
// Add fee for this hop.
|
||||
if !localChan {
|
||||
runningAmt += policy.ComputeFee(runningAmt)
|
||||
runningAmt += policy.policy.ComputeFee(runningAmt)
|
||||
}
|
||||
|
||||
log.Tracef("Select channel %v at position %v", policy.ChannelID, i)
|
||||
log.Tracef("Select channel %v at position %v",
|
||||
policy.policy.ChannelID, i)
|
||||
|
||||
edges[i] = unifiedPolicy
|
||||
}
|
||||
@@ -2862,12 +2863,12 @@ func (r *ChannelRouter) BuildRoute(amt *lnwire.MilliSatoshi,
|
||||
|
||||
if i > 0 {
|
||||
// Decrease the amount to send while going forward.
|
||||
receiverAmt -= policy.ComputeFeeFromIncoming(
|
||||
receiverAmt -= policy.policy.ComputeFeeFromIncoming(
|
||||
receiverAmt,
|
||||
)
|
||||
}
|
||||
|
||||
pathEdges = append(pathEdges, policy)
|
||||
pathEdges = append(pathEdges, policy.policy)
|
||||
}
|
||||
|
||||
// Build and return the final route.
|
||||
|
Reference in New Issue
Block a user