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 2016-07-21 16:18:42 -07:00
parent 504c8bf5f3
commit 65435bd8e6
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

@ -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