@@ -16,6 +16,7 @@ import (
1616 "github.com/lightninglabs/loop/loopdb"
1717 "github.com/lightninglabs/loop/swap"
1818 "github.com/lightninglabs/loop/swapserverrpc"
19+ "github.com/lightninglabs/loop/utils"
1920 "github.com/lightningnetwork/lnd/lnrpc"
2021 "github.com/lightningnetwork/lnd/lnrpc/walletrpc"
2122 "github.com/lightningnetwork/lnd/lntypes"
@@ -460,11 +461,10 @@ func (f *FSM) WaitForSweeplessSweepConfirmedAction(ctx context.Context,
460461 return f .HandleError (err )
461462 }
462463
463- confChan , confErrChan , err := f .cfg .ChainNotifier .
464- RegisterConfirmationsNtfn (
465- ctx , f .InstantOut .SweepTxHash , pkscript ,
466- 1 , f .InstantOut .initiationHeight ,
467- )
464+ confChan , confErrChan , err := utils .RegisterConfirmationsNtfnWithRetry (
465+ ctx , f .cfg .ChainNotifier , f .InstantOut .SweepTxHash , pkscript ,
466+ 1 , f .InstantOut .initiationHeight ,
467+ )
468468 if err != nil {
469469 return f .HandleError (err )
470470 }
@@ -505,12 +505,11 @@ func (f *FSM) PublishHtlcAction(ctx context.Context,
505505 f .Debugf ("published htlc tx: %v" , txHash )
506506
507507 // We'll now wait for the htlc to be confirmed.
508- confChan , confErrChan , err := f .cfg .ChainNotifier .
509- RegisterConfirmationsNtfn (
510- ctx , & txHash ,
511- f .InstantOut .finalizedHtlcTx .TxOut [0 ].PkScript ,
512- 1 , f .InstantOut .initiationHeight ,
513- )
508+ confChan , confErrChan , err := utils .RegisterConfirmationsNtfnWithRetry (
509+ ctx , f .cfg .ChainNotifier , & txHash ,
510+ f .InstantOut .finalizedHtlcTx .TxOut [0 ].PkScript ,
511+ 1 , f .InstantOut .initiationHeight ,
512+ )
514513 if err != nil {
515514 return f .HandleError (err )
516515 }
@@ -575,9 +574,9 @@ func (f *FSM) WaitForHtlcSweepConfirmedAction(ctx context.Context,
575574 return f .HandleError (err )
576575 }
577576
578- confChan , confErrChan , err := f . cfg . ChainNotifier . RegisterConfirmationsNtfn (
579- ctx , f .InstantOut . SweepTxHash , sweepPkScript ,
580- 1 , f .InstantOut .initiationHeight ,
577+ confChan , confErrChan , err := utils . RegisterConfirmationsNtfnWithRetry (
578+ ctx , f .cfg . ChainNotifier , f . InstantOut . SweepTxHash ,
579+ sweepPkScript , 1 , f .InstantOut .initiationHeight ,
581580 )
582581 if err != nil {
583582 return f .HandleError (err )
0 commit comments