Skip to content

Commit 9a03083

Browse files
committed
staticaddr: re-sub for invoice on subscription error
1 parent 079fadc commit 9a03083

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

staticaddr/loopin/actions.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,18 @@ func (f *FSM) MonitorInvoiceAndHtlcTxAction(ctx context.Context,
695695
case err = <-invoiceErrChan:
696696
f.Errorf("invoice subscription error: %v", err)
697697

698+
// Re-register for invoice updates.
699+
invoiceUpdateChan, invoiceErrChan, err =
700+
f.cfg.InvoicesClient.SubscribeSingleInvoice(
701+
subscribeCtx, f.loopIn.SwapHash,
702+
)
703+
if err != nil {
704+
err = fmt.Errorf("unable to subscribe to swap "+
705+
"invoice: %v", err)
706+
707+
return f.HandleError(err)
708+
}
709+
698710
case <-ctx.Done():
699711
return f.HandleError(ctx.Err())
700712
}

0 commit comments

Comments
 (0)