From e13f96e64bd5a0d49ff7fc9fbed20cfa1d2ddfa8 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sun, 8 Jul 2018 16:34:25 -0700 Subject: [PATCH] routing: ensure we create a pruneViewSnapshot for route sessions In this commit, we fix an existing bug that could at times lead to a panic if a user manually crafts a route via SendToRoute, and that route results in a payment error. The fix is simple: create the map even though it won't be used in the sessions since the user is feeding the router manual routes. --- routing/missioncontrol.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/routing/missioncontrol.go b/routing/missioncontrol.go index 9e0fa9086..89aa753cb 100644 --- a/routing/missioncontrol.go +++ b/routing/missioncontrol.go @@ -249,9 +249,10 @@ func (m *missionControl) NewPaymentSession(routeHints [][]HopHint, // used for things like channel rebalancing, and swaps. func (m *missionControl) NewPaymentSessionFromRoutes(routes []*Route) *paymentSession { return &paymentSession{ - haveRoutes: true, - preBuiltRoutes: routes, - mc: m, + pruneViewSnapshot: m.GraphPruneView(), + haveRoutes: true, + preBuiltRoutes: routes, + mc: m, } }