routing: exit on unexpected RequestRoute error

We whitelist a set of "expected" errors that can be returned from
RequestRoute, by converting them into a new type noRouteError. For any
other error returned by RequestRoute, we'll now exit immediately.
This commit is contained in:
Johan T. Halseth
2020-04-01 00:13:27 +02:00
parent fee5fd0093
commit 5e72a4b77c
4 changed files with 73 additions and 43 deletions

View File

@@ -141,7 +141,7 @@ func (m *mockPaymentSession) RequestRoute(_, _ lnwire.MilliSatoshi,
_, height uint32) (*route.Route, error) {
if len(m.routes) == 0 {
return nil, fmt.Errorf("no routes")
return nil, errNoPathFound
}
r := m.routes[0]