routing: remove redundant fee limit check in newRoute
This check was a left over from when the fee limit wasn't checked yet in the path finding algorithm.
This commit is contained in:
4 files changed
+8
-71
No files matched your search
+3
-4
@@ -1266,7 +1266,7 @@ type routingMsg struct {
|
||||
// initial set of paths as it's possible we drop a route if it can't handle the
|
||||
// total payment flow after fees are calculated.
|
||||
func pathsToFeeSortedRoutes(source Vertex, paths [][]*channeldb.ChannelEdgePolicy,
|
||||
finalCLTVDelta uint16, amt, feeLimit lnwire.MilliSatoshi,
|
||||
finalCLTVDelta uint16, amt lnwire.MilliSatoshi,
|
||||
currentHeight uint32) ([]*Route, error) {
|
||||
|
||||
validRoutes := make([]*Route, 0, len(paths))
|
||||
@@ -1275,8 +1275,7 @@ func pathsToFeeSortedRoutes(source Vertex, paths [][]*channeldb.ChannelEdgePolic
|
||||
// hop in the path as it contains a "self-hop" that is inserted
|
||||
// by our KSP algorithm.
|
||||
route, err := newRoute(
|
||||
amt, feeLimit, source, path[1:], currentHeight,
|
||||
finalCLTVDelta,
|
||||
amt, source, path[1:], currentHeight, finalCLTVDelta,
|
||||
)
|
||||
if err != nil {
|
||||
// TODO(roasbeef): report straw breaking edge?
|
||||
@@ -1412,7 +1411,7 @@ func (r *ChannelRouter) FindRoutes(target *btcec.PublicKey,
|
||||
// factored in.
|
||||
sourceVertex := Vertex(r.selfNode.PubKeyBytes)
|
||||
validRoutes, err := pathsToFeeSortedRoutes(
|
||||
sourceVertex, shortestPaths, finalCLTVDelta, amt, feeLimit,
|
||||
sourceVertex, shortestPaths, finalCLTVDelta, amt,
|
||||
uint32(currentHeight),
|
||||
)
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user