diff --git a/routing/route/route.go b/routing/route/route.go index 9b010e77..2cd04684 100644 --- a/routing/route/route.go +++ b/routing/route/route.go @@ -103,6 +103,10 @@ func (r *Route) HopFee(hopIndex int) lnwire.MilliSatoshi { // the case of a one-hop payment, this value will be zero as we don't need to // pay a fee to ourself. func (r *Route) TotalFees() lnwire.MilliSatoshi { + if len(r.Hops) == 0 { + return 0 + } + return r.TotalAmount - r.Hops[len(r.Hops)-1].AmtToForward }