Skip to content

Commit 258d33c

Browse files
stariushieblmi
authored andcommitted
staticaddr: clear stale HTLC confs on re-register
- reset htlcConfirmed when the HTLC conf subscription errors and we re-register - add regression test ensuring re-registers after a conf error require a fresh confirmation instead of sweeping on a stale one
1 parent f6ac0b5 commit 258d33c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

staticaddr/loopin/actions.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,10 @@ func (f *FSM) MonitorInvoiceAndHtlcTxAction(ctx context.Context,
575575
f.Errorf("htlc tx conf chan error, re-registering: "+
576576
"%v", err)
577577

578+
// A previous confirmation may no longer be valid if the
579+
// subscription failed, so reset and wait for a fresh one.
580+
htlcConfirmed = false
581+
578582
// Re-register for htlc confirmation.
579583
htlcConfChan, htlcErrConfChan, err = registerHtlcConf()
580584
if err != nil {

0 commit comments

Comments
 (0)