prevent EOF loop

This commit is contained in:
kiwiidb
2023-04-07 15:04:47 +02:00
parent c7f2d8558e
commit 783fb4b71c

View File

@@ -198,7 +198,10 @@ func (client *DefaultClient) SubscribeToLndInvoices(ctx context.Context, handler
select { select {
case <-ctx.Done(): case <-ctx.Done():
return context.Canceled return context.Canceled
case delivery := <-deliveryChan: case delivery, ok := <-deliveryChan:
if !ok {
return fmt.Errorf("Disconnected from RabbitMQ")
}
var invoice lnrpc.Invoice var invoice lnrpc.Invoice
err := json.Unmarshal(delivery.Body, &invoice) err := json.Unmarshal(delivery.Body, &invoice)