lnrpc+routing: Only accept a single route for SendToRoute

This commit is contained in:
Joost Jager committed 2019-05-15 11:54:46 +02:00
1 parent 0b66d56aab
commit ba3fa94268
10 files changed
+693 -736

No files matched your search

+4 -8
View File
@@ -231,18 +231,14 @@ func (m *missionControl) NewPaymentSession(routeHints [][]zpay32.HopHint,
}, nil
}
// NewPaymentSessionFromRoutes creates a new paymentSession instance that will
// skip all path finding, and will instead utilize a set of pre-built routes.
// This constructor allows callers to specify their own routes which can be
// used for things like channel rebalancing, and swaps.
func (m *missionControl) NewPaymentSessionFromRoutes(routes []*route.Route) *paymentSession {
// NewPaymentSessionForRoute creates a new paymentSession instance that is just
// used for failure reporting to missioncontrol.
func (m *missionControl) NewPaymentSessionForRoute(preBuiltRoute *route.Route) *paymentSession {
return &paymentSession{
pruneViewSnapshot: m.GraphPruneView(),
haveRoutes: true,
preBuiltRoutes: routes,
errFailedPolicyChans: make(map[EdgeLocator]struct{}),
mc: m,
pathFinder: findPath,
preBuiltRoute: preBuiltRoute,
}
}