|
7 | 7 | "fmt" |
8 | 8 | "strings" |
9 | 9 | "sync" |
10 | | - "sync/atomic" |
11 | 10 |
|
12 | 11 | "github.com/btcsuite/btcd/btcec/v2/schnorr" |
13 | 12 | "github.com/btcsuite/btcd/btcec/v2/schnorr/musig2" |
@@ -133,24 +132,20 @@ type Manager struct { |
133 | 132 | // errChan forwards errors from the withdrawal manager to the server. |
134 | 133 | errChan chan error |
135 | 134 |
|
136 | | - // initiationHeight stores the currently best known block height. |
137 | | - initiationHeight atomic.Uint32 |
138 | | - |
139 | 135 | // finalizedWithdrawalTx are the finalized withdrawal transactions that |
140 | 136 | // are published to the network and re-published on block arrivals. |
141 | 137 | finalizedWithdrawalTxns map[chainhash.Hash]*wire.MsgTx |
142 | 138 | } |
143 | 139 |
|
144 | 140 | // NewManager creates a new deposit withdrawal manager. |
145 | | -func NewManager(cfg *ManagerConfig, currentHeight uint32) *Manager { |
| 141 | +func NewManager(cfg *ManagerConfig) *Manager { |
146 | 142 | m := &Manager{ |
147 | 143 | cfg: cfg, |
148 | 144 | finalizedWithdrawalTxns: make(map[chainhash.Hash]*wire.MsgTx), |
149 | 145 | exitChan: make(chan struct{}), |
150 | 146 | newWithdrawalRequestChan: make(chan newWithdrawalRequest), |
151 | 147 | errChan: make(chan error), |
152 | 148 | } |
153 | | - m.initiationHeight.Store(currentHeight) |
154 | 149 |
|
155 | 150 | return m |
156 | 151 | } |
@@ -669,7 +664,7 @@ func (m *Manager) handleWithdrawal(ctx context.Context, |
669 | 664 | m.cfg.ChainNotifier.RegisterConfirmationsNtfn( |
670 | 665 | ctx, spentTx.SpenderTxHash, |
671 | 666 | withdrawalPkscript, MinConfs, |
672 | | - int32(m.initiationHeight.Load()), |
| 667 | + int32(d.ConfirmationHeight), |
673 | 668 | ) |
674 | 669 | select { |
675 | 670 | case tx := <-confChan: |
|
0 commit comments