From 258d33cce5d25a51725a2ac47585263b4cc20dd9 Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Tue, 16 Dec 2025 18:16:41 -0300 Subject: [PATCH] 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 --- staticaddr/loopin/actions.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/staticaddr/loopin/actions.go b/staticaddr/loopin/actions.go index fce10b1a..837a6eb8 100644 --- a/staticaddr/loopin/actions.go +++ b/staticaddr/loopin/actions.go @@ -575,6 +575,10 @@ func (f *FSM) MonitorInvoiceAndHtlcTxAction(ctx context.Context, f.Errorf("htlc tx conf chan error, re-registering: "+ "%v", err) + // A previous confirmation may no longer be valid if the + // subscription failed, so reset and wait for a fresh one. + htlcConfirmed = false + // Re-register for htlc confirmation. htlcConfChan, htlcErrConfChan, err = registerHtlcConf() if err != nil {