From 65435bd8e6aab18cb130366c3e1a6b45598b6e38 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 21 Jul 2016 16:18:42 -0700 Subject: [PATCH] cmd/lncli: close sendpayment stream after recv We now close the send payment stream after receiving a response. Otherwise if the RPC server is asynchronously handling requests then, closing the stream would result in the server returning an EOF error, terminating the request. --- cmd/lncli/commands.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go index ecb0dbf2..418737a9 100644 --- a/cmd/lncli/commands.go +++ b/cmd/lncli/commands.go @@ -491,13 +491,14 @@ func sendPaymentCommand(ctx *cli.Context) error { if err := paymentStream.Send(req); err != nil { return err } - paymentStream.CloseSend() resp, err := paymentStream.Recv() if err != nil { return err } + paymentStream.CloseSend() + printRespJson(resp) return nil