From ea6f6d6069cdfc0b24810e5e1c96684beb452379 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Mon, 26 Dec 2016 23:51:18 -0600 Subject: [PATCH] rpcserver: modify SendPayment to use new routing pkg API --- rpcserver.go | 135 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 79 insertions(+), 56 deletions(-) diff --git a/rpcserver.go b/rpcserver.go index 81c2b768..d9728b67 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -609,7 +609,8 @@ func (r *rpcServer) ListChannels(ctx context.Context, return resp, nil } -func constructPayment(path []graph.Vertex, amount btcutil.Amount, rHash []byte) *channeldb.OutgoingPayment { +func constructPayment(route *routing.Route, amount btcutil.Amount, + rHash []byte) *channeldb.OutgoingPayment { payment := &channeldb.OutgoingPayment{} @@ -621,9 +622,10 @@ func constructPayment(path []graph.Vertex, amount btcutil.Amount, rHash []byte) payment.Invoice.CreationDate = time.Now() payment.Timestamp = time.Now() - pathBytes33 := make([][33]byte, len(path)) - for i:=0; i