Commit e760d1c6 authored by OptimismBot's avatar OptimismBot Committed by GitHub

Merge pull request #6402 from ethereum-optimism/refcell/agent-touchup

fix(op-challenger): Small Agent Touchup
parents 1421ce9d d4ce261a
...@@ -55,16 +55,15 @@ func (a *Agent) Act(ctx context.Context) error { ...@@ -55,16 +55,15 @@ func (a *Agent) Act(ctx context.Context) error {
// tryResolve resolves the game if it is in a terminal state // tryResolve resolves the game if it is in a terminal state
// and returns true if the game resolves successfully. // and returns true if the game resolves successfully.
func (a *Agent) tryResolve(ctx context.Context) bool { func (a *Agent) tryResolve(ctx context.Context) bool {
if a.responder.CanResolve(ctx) { if !a.responder.CanResolve(ctx) {
return false
}
a.log.Info("Resolving game") a.log.Info("Resolving game")
err := a.responder.Resolve(ctx) if err := a.responder.Resolve(ctx); err != nil {
if err != nil {
a.log.Error("Failed to resolve the game", "err", err) a.log.Error("Failed to resolve the game", "err", err)
return false return false
} }
return true return true
}
return false
} }
// newGameFromContracts initializes a new game state from the state in the contract // newGameFromContracts initializes a new game state from the state in the contract
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment