diff --git a/routing/pathfind.go b/routing/pathfind.go index e2209d5b7..d19c88634 100644 --- a/routing/pathfind.go +++ b/routing/pathfind.go @@ -302,6 +302,8 @@ func newRoute(amtToSend lnwire.MilliSatoshi, sourceVertex Vertex, } edge.Node.PubKey.Curve = nil + route.TotalFees += nextHop.Fee + // As a sanity check, we ensure that the selected channel has // enough capacity to forward the required amount which // includes the fee dictated at each hop. diff --git a/routing/router_test.go b/routing/router_test.go index 8568cbf29..c3b43098e 100644 --- a/routing/router_test.go +++ b/routing/router_test.go @@ -186,7 +186,7 @@ func TestFindRoutesFeeSorting(t *testing.T) { routes[0].TotalFees) } if routes[1].TotalFees == 0 { - t.Fatalf("total fees not set in second route: ", + t.Fatalf("total fees not set in second route: %v", spew.Sdump(routes[0])) }