diff --git a/eth/catalyst/simulated_beacon_api.go b/eth/catalyst/simulated_beacon_api.go index 5955b033bd..9e5888dfa7 100644 --- a/eth/catalyst/simulated_beacon_api.go +++ b/eth/catalyst/simulated_beacon_api.go @@ -70,15 +70,10 @@ func (a *simulatedBeaconAPI) loop() { if executable, _ := a.sim.eth.TxPool().Stats(); executable == 0 { break } - // Avoid a race condition where doCommit is closed while in this loop. - select { - case _, ok := <-doCommit: - if !ok { - break - } - default: + // Avoids spinlooping if the txPool is alredy terminated. + if _, err := a.sim.fallibleCommit(); err != nil { + break } - a.sim.Commit() } } }()