Skip to content

Commit 7cc50fe

Browse files
committed
lock debug
1 parent 3158546 commit 7cc50fe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

staticaddr/deposit/manager.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,9 +526,6 @@ func (m *Manager) TransitionDeposits(ctx context.Context, deposits []*Deposit,
526526
outpoints[i] = d.OutPoint
527527
}
528528

529-
m.mu.Lock()
530-
defer m.mu.Unlock()
531-
532529
stateMachines, _ := m.toActiveDeposits(&outpoints)
533530
if stateMachines == nil {
534531
return fmt.Errorf("deposits not found in active deposits")
@@ -580,6 +577,9 @@ func (m *Manager) UpdateDeposit(ctx context.Context, d *Deposit) error {
580577
func (m *Manager) toActiveDeposits(outpoints *[]wire.OutPoint) ([]*FSM,
581578
[]*Deposit) {
582579

580+
m.mu.Lock()
581+
defer m.mu.Unlock()
582+
583583
fsms := make([]*FSM, 0, len(*outpoints))
584584
deposits := make([]*Deposit, 0, len(*outpoints))
585585
for _, o := range *outpoints {

0 commit comments

Comments
 (0)