Skip to content

Commit

Permalink
Merge pull request #1217 from lightninglabs/sendpayment-eof
Browse files Browse the repository at this point in the history
rpc: try to catch EOF error from lnd sendpayment
  • Loading branch information
Roasbeef authored Dec 4, 2024
2 parents 1589ddc + e414f23 commit 651ab88
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -7309,7 +7309,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{
Expand Down

0 comments on commit 651ab88

Please sign in to comment.