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.
This commit is contained in:
Olaoluwa Osuntokun 2018-07-08 16:34:25 -07:00
parent 03650bbb18
commit e13f96e64b
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -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,
}
}