Skip to content

Commit

Permalink
rpc: try to catch EOF error from lnd sendpayment
Browse files Browse the repository at this point in the history
  • Loading branch information
Roasbeef committed Nov 26, 2024
1 parent 783fb1e commit e414f23
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 @@ -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{
Expand Down

0 comments on commit e414f23

Please sign in to comment.