From e414f23a508e11e087826647bd7a7cd7f5b8fffa Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 26 Nov 2024 14:36:42 -0600 Subject: [PATCH] rpc: try to catch EOF error from lnd sendpayment --- rpcserver.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rpcserver.go b/rpcserver.go index b0aae3a09..463677e7b 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -7193,7 +7193,12 @@ func (r *rpcServer) SendPayment(req *tchrpc.SendPaymentRequest, update, err := updateStream.Recv() if err != nil { - return err + // Stream is closed; no more updates. + if err == io.EOF { + return nil + } + return fmt.Errorf("failed to receive payment "+ + "update: %w", err) } err = stream.Send(&tchrpc.SendPaymentResponse{