routing/route+multi: remove redundant TotalFees field
Instead get it on demand using method TotalFees().
This commit is contained in:
8 files changed
+17
-18
No files matched your search
@@ -185,8 +185,8 @@ func calculateFeeLimit(feeLimit *lnrpc.FeeLimit,
|
||||
func (r *RouterBackend) MarshallRoute(route *route.Route) *lnrpc.Route {
|
||||
resp := &lnrpc.Route{
|
||||
TotalTimeLock: route.TotalTimeLock,
|
||||
TotalFees: int64(route.TotalFees.ToSatoshis()),
|
||||
TotalFeesMsat: int64(route.TotalFees),
|
||||
TotalFees: int64(route.TotalFees().ToSatoshis()),
|
||||
TotalFeesMsat: int64(route.TotalFees()),
|
||||
TotalAmt: int64(route.TotalAmount.ToSatoshis()),
|
||||
TotalAmtMsat: int64(route.TotalAmount),
|
||||
Hops: make([]*lnrpc.Hop, len(route.Hops)),
|
||||
|
||||
@@ -55,8 +55,6 @@ func TestQueryRoutes(t *testing.T) {
|
||||
}},
|
||||
}
|
||||
|
||||
rt := &route.Route{}
|
||||
|
||||
findRoute := func(source, target route.Vertex,
|
||||
amt lnwire.MilliSatoshi, restrictions *routing.RestrictParams,
|
||||
finalExpiry ...uint16) (*route.Route, error) {
|
||||
@@ -95,7 +93,8 @@ func TestQueryRoutes(t *testing.T) {
|
||||
t.Fatal("unexpected ignored node")
|
||||
}
|
||||
|
||||
return rt, nil
|
||||
hops := []*route.Hop{&route.Hop{}}
|
||||
return route.NewRouteFromHops(amt, 144, source, hops)
|
||||
}
|
||||
|
||||
backend := &RouterBackend{
|
||||
|
||||
@@ -269,7 +269,7 @@ func (s *Server) EstimateRouteFee(ctx context.Context,
|
||||
}
|
||||
|
||||
return &RouteFeeResponse{
|
||||
RoutingFeeMsat: int64(route.TotalFees),
|
||||
RoutingFeeMsat: int64(route.TotalFees()),
|
||||
TimeLockDelay: int64(route.TotalTimeLock),
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user