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:
parent
504c8bf5f3
commit
65435bd8e6
@ -491,13 +491,14 @@ func sendPaymentCommand(ctx *cli.Context) error {
|
|||||||
if err := paymentStream.Send(req); err != nil {
|
if err := paymentStream.Send(req); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
paymentStream.CloseSend()
|
|
||||||
|
|
||||||
resp, err := paymentStream.Recv()
|
resp, err := paymentStream.Recv()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
paymentStream.CloseSend()
|
||||||
|
|
||||||
printRespJson(resp)
|
printRespJson(resp)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user