Skip to content

Commit 079fadc

Browse files
committed
staticaddr: re-register on htlc tx conf error
1 parent c3f3199 commit 079fadc

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

staticaddr/loopin/actions.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,17 @@ func (f *FSM) MonitorInvoiceAndHtlcTxAction(ctx context.Context,
572572
htlcConfirmed = true
573573

574574
case err = <-htlcErrConfChan:
575-
f.Errorf("htlc tx conf chan error: %v", err)
575+
f.Errorf("htlc tx conf chan error, re-registering: "+
576+
"%v", err)
577+
578+
// Re-register for htlc confirmation.
579+
htlcConfChan, htlcErrConfChan, err = registerHtlcConf()
580+
if err != nil {
581+
err = fmt.Errorf("unable to re-register for "+
582+
"htlc tx confirmation: %w", err)
583+
584+
return f.HandleError(err)
585+
}
576586

577587
case <-reorgChan:
578588
// A reorg happened. We invalidate a previous htlc
@@ -582,8 +592,10 @@ func (f *FSM) MonitorInvoiceAndHtlcTxAction(ctx context.Context,
582592

583593
htlcConfChan, htlcErrConfChan, err = registerHtlcConf()
584594
if err != nil {
585-
f.Errorf("unable to monitor htlc tx "+
595+
err = fmt.Errorf("unable to monitor htlc tx "+
586596
"confirmation: %v", err)
597+
598+
return f.HandleError(err)
587599
}
588600

589601
case <-deadlineChan:

0 commit comments

Comments
 (0)