Skip to content

Commit

Permalink
rpcserver: return full path payments go over in SendPayment
Browse files Browse the repository at this point in the history
This commit augments the server’s response to successful SendPayment
commands by also returning the full path taken in order to fulfill the
payment. With this information, the user now obtains more context about
their payment whcih can be useful when debugging, or just exploring the
capabilities of the daemon.
  • Loading branch information
Roasbeef committed Jan 17, 2017
1 parent 765d9fd commit 7d6d818
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 9 additions & 3 deletions rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,9 @@ func (r *rpcServer) SendPayment(paymentStream lnrpc.Lightning_SendPaymentServer)
}

// TODO(roasbeef): proper responses
resp := &lnrpc.SendResponse{}
resp := &lnrpc.SendResponse{
PaymentRoute: marshalRoute(route),
}
if err := paymentStream.Send(resp); err != nil {
errChan <- err
return
Expand Down Expand Up @@ -1560,9 +1562,13 @@ func (r *rpcServer) QueryRoute(_ context.Context, in *lnrpc.RouteRequest) (*lnrp
return nil, err
}

// If a route exsits within the network that is able to support our
// If a route exists within the network that is able to support our
// request, then we'll convert the result into the format required by
// the RPC system.
return marshalRoute(route), nil
}

func marshalRoute(route *routing.Route) *lnrpc.Route {
resp := &lnrpc.Route{
TotalTimeLock: route.TotalTimeLock,
TotalFees: int64(route.TotalFees),
Expand All @@ -1578,7 +1584,7 @@ func (r *rpcServer) QueryRoute(_ context.Context, in *lnrpc.RouteRequest) (*lnrp
}
}

return resp, nil
return resp
}

// GetNetworkInfo returns some basic stats about the known channel graph from
Expand Down
2 changes: 2 additions & 0 deletions utxonursery.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ func (u *utxoNursery) catchUpKindergarten() error {
}
}

utxnLog.Infof("UTXO Nursery is now fully synced")

return nil
}

Expand Down

0 comments on commit 7d6d818

Please sign in to comment.