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.
This commit is contained in:
Olaoluwa Osuntokun committed 2016-07-21 16:18:56 -07:00
1 parent 504c8bf5f3
commit 65435bd8e6
1 file changed
+2 -1
+2 -1
View File
@@ -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