invoices: fix synchronization issue with single invoice subscribers
This commit fixes a synchronization issue where a single invoice subscriber could receive duplicate and/or out of order invoice updates.
This commit is contained in:
3 files changed
+73
-42
No files matched your search
@@ -178,7 +178,10 @@ func (s *Server) SubscribeSingleInvoice(req *SubscribeSingleInvoiceRequest,
|
||||
return err
|
||||
}
|
||||
|
||||
invoiceClient := s.cfg.InvoiceRegistry.SubscribeSingleInvoice(hash)
|
||||
invoiceClient, err := s.cfg.InvoiceRegistry.SubscribeSingleInvoice(hash)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer invoiceClient.Cancel()
|
||||
|
||||
for {
|
||||
|
||||
Reference in new issue
Block a user