routing/route: define route.ReceiverAmt() method
This commit is contained in:
3 files changed
+31
-5
No files matched your search
+10
-1
@@ -308,7 +308,16 @@ func (r *Route) TotalFees() lnwire.MilliSatoshi {
|
||||
return 0
|
||||
}
|
||||
|
||||
return r.TotalAmount - r.Hops[len(r.Hops)-1].AmtToForward
|
||||
return r.TotalAmount - r.ReceiverAmt()
|
||||
}
|
||||
|
||||
// ReceiverAmt is the amount received by the final hop of this route.
|
||||
func (r *Route) ReceiverAmt() lnwire.MilliSatoshi {
|
||||
if len(r.Hops) == 0 {
|
||||
return 0
|
||||
}
|
||||
|
||||
return r.Hops[len(r.Hops)-1].AmtToForward
|
||||
}
|
||||
|
||||
// NewRouteFromHops creates a new Route structure from the minimally required
|
||||
|
||||
Reference in new issue
Block a user