|
7 | 7 | "github.com/btcsuite/btcd/btcutil" |
8 | 8 | "github.com/lightninglabs/loop/fsm" |
9 | 9 | "github.com/lightninglabs/loop/swapserverrpc" |
| 10 | + "github.com/lightninglabs/loop/utils" |
10 | 11 | "github.com/lightningnetwork/lnd/chainntnfs" |
11 | 12 | ) |
12 | 13 |
|
@@ -103,8 +104,8 @@ func (f *FSM) SubscribeToConfirmationAction(ctx context.Context, |
103 | 104 | return f.HandleError(err) |
104 | 105 | } |
105 | 106 |
|
106 | | - blockChan, errBlockChan, err := f.cfg.ChainNotifier.RegisterBlockEpochNtfn( |
107 | | - callCtx, |
| 107 | + blockChan, errBlockChan, err := utils.RegisterBlockEpochNtfnWithRetry( |
| 108 | + callCtx, f.cfg.ChainNotifier, |
108 | 109 | ) |
109 | 110 | if err != nil { |
110 | 111 | f.Errorf("unable to subscribe to block notifications: %v", err) |
@@ -158,8 +159,9 @@ func (f *FSM) AsyncWaitForExpiredOrSweptAction(ctx context.Context, |
158 | 159 |
|
159 | 160 | notifCtx, cancel := context.WithCancel(ctx) |
160 | 161 |
|
161 | | - blockHeightChan, errEpochChan, err := f.cfg.ChainNotifier. |
162 | | - RegisterBlockEpochNtfn(notifCtx) |
| 162 | + blockHeightChan, errEpochChan, err := utils.RegisterBlockEpochNtfnWithRetry( |
| 163 | + notifCtx, f.cfg.ChainNotifier, |
| 164 | + ) |
163 | 165 | if err != nil { |
164 | 166 | cancel() |
165 | 167 | return f.HandleError(err) |
|
0 commit comments