Skip to content

Commit c611697

Browse files
committed
staticaddr: withdrawal changes to be squashed
1 parent a50d3d7 commit c611697

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

staticaddr/deposit/manager.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@ func (m *Manager) Run(ctx context.Context, currentHeight uint32) error {
146146
}
147147
case outpoint := <-m.finalizedDepositChan:
148148
// If deposits notify us about their finalization, we
149-
// update the manager's internal state and flush the
149+
// update the manager's internal state by flushing the
150150
// finalized deposit from memory.
151-
m.finalizeDeposit(outpoint)
151+
delete(m.activeDeposits, outpoint)
152152

153153
case err = <-newBlockErrChan:
154154
return err
@@ -403,12 +403,6 @@ func (m *Manager) startDepositFsm(ctx context.Context, deposit *Deposit) error {
403403
return nil
404404
}
405405

406-
func (m *Manager) finalizeDeposit(outpoint wire.OutPoint) {
407-
m.mu.Lock()
408-
delete(m.activeDeposits, outpoint)
409-
m.mu.Unlock()
410-
}
411-
412406
// GetActiveDepositsInState returns all active deposits. This function is called
413407
// on a client restart before the manager is fully initialized, hence we don't
414408
// have to lock the deposits.

0 commit comments

Comments
 (0)