Skip to content

Commit fd711d5

Browse files
committed
staticaddr: concurrency safe deposit recovery
1 parent e7dbb7a commit fd711d5

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
@@ -196,13 +196,13 @@ func (m *Manager) recoverDeposits(ctx context.Context) error {
196196
}
197197

198198
// Send the OnRecover event to the state machine.
199-
go func() {
200-
err = fsm.SendEvent(ctx, OnRecover, nil)
199+
go func(fsm *FSM) {
200+
err := fsm.SendEvent(ctx, OnRecover, nil)
201201
if err != nil {
202202
log.Errorf("Error sending OnStart event: %v",
203203
err)
204204
}
205-
}()
205+
}(fsm)
206206

207207
m.mu.Lock()
208208
m.activeDeposits[d.OutPoint] = fsm

0 commit comments

Comments
 (0)