diff --git a/eth/catalyst/simulated_beacon.go b/eth/catalyst/simulated_beacon.go index de6ab8e6bd..86355a1533 100644 --- a/eth/catalyst/simulated_beacon.go +++ b/eth/catalyst/simulated_beacon.go @@ -54,11 +54,10 @@ type newWithdrawalsEvent struct{ Withdrawals types.Withdrawals } // add queues a withdrawal for future inclusion. func (w *withdrawalQueue) add(withdrawal *types.Withdrawal) error { w.mu.Lock() - defer w.mu.Unlock() - w.pending = append(w.pending, withdrawal) - w.feed.Send(newWithdrawalsEvent{types.Withdrawals{withdrawal}}) + w.mu.Unlock() + w.feed.Send(newWithdrawalsEvent{types.Withdrawals{withdrawal}}) return nil } diff --git a/eth/catalyst/simulated_beacon_api.go b/eth/catalyst/simulated_beacon_api.go index da95be18d3..79a0121b5b 100644 --- a/eth/catalyst/simulated_beacon_api.go +++ b/eth/catalyst/simulated_beacon_api.go @@ -54,7 +54,8 @@ func (a *simulatedBeaconAPI) loop() { ) defer newTxsSub.Unsubscribe() defer newWxsSub.Unsubscribe() - // a background thread which signals to the simulator when to commit + + // A background thread which signals to the simulator when to commit // based on messages over doCommit. go func() { for _ = range doCommit {