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 committed 2020-04-02 19:31:24 +02:00
1 parent fee5fd0093
commit 5e72a4b77c
4 files changed
+73 -43

No files matched your search

+1 -1
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]