routing: use unified policy for build route

This commit is contained in:
Joost Jager
2019-09-30 15:45:16 +02:00
parent a347237e7a
commit 729c3a6bd6
3 changed files with 85 additions and 217 deletions

View File

@@ -267,3 +267,15 @@ func (u *unifiedPolicy) getPolicyNetwork(
return &modifiedPolicy
}
// minAmt returns the minimum amount that can be forwarded on this connection.
func (u *unifiedPolicy) minAmt() lnwire.MilliSatoshi {
min := lnwire.MaxMilliSatoshi
for _, edge := range u.edges {
if edge.policy.MinHTLC < min {
min = edge.policy.MinHTLC
}
}
return min
}