rpcserver: include millisatoshis in marshallRoute

This commit is contained in:
t4sk 2018-04-12 14:24:03 +08:00
parent 31feeca51a
commit 49510d775f

@ -2745,16 +2745,20 @@ func marshallRoute(route *routing.Route) *lnrpc.Route {
resp := &lnrpc.Route{ resp := &lnrpc.Route{
TotalTimeLock: route.TotalTimeLock, TotalTimeLock: route.TotalTimeLock,
TotalFees: int64(route.TotalFees.ToSatoshis()), TotalFees: int64(route.TotalFees.ToSatoshis()),
TotalFeesMsat: int64(route.TotalFees),
TotalAmt: int64(route.TotalAmount.ToSatoshis()), TotalAmt: int64(route.TotalAmount.ToSatoshis()),
TotalAmtMsat: int64(route.TotalAmount),
Hops: make([]*lnrpc.Hop, len(route.Hops)), Hops: make([]*lnrpc.Hop, len(route.Hops)),
} }
for i, hop := range route.Hops { for i, hop := range route.Hops {
resp.Hops[i] = &lnrpc.Hop{ resp.Hops[i] = &lnrpc.Hop{
ChanId: hop.Channel.ChannelID, ChanId: hop.Channel.ChannelID,
ChanCapacity: int64(hop.Channel.Capacity), ChanCapacity: int64(hop.Channel.Capacity),
AmtToForward: int64(hop.AmtToForward.ToSatoshis()), AmtToForward: int64(hop.AmtToForward.ToSatoshis()),
Fee: int64(hop.Fee.ToSatoshis()), AmtToForwardMsat: int64(hop.AmtToForward),
Expiry: uint32(hop.OutgoingTimeLock), Fee: int64(hop.Fee.ToSatoshis()),
FeeMsat: int64(hop.Fee),
Expiry: uint32(hop.OutgoingTimeLock),
} }
} }