Commit dc4168e3 authored by Andreas Bigger's avatar Andreas Bigger

Small agent touchup following Adrian's pr.

parent 3c0e8a98
...@@ -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) {
a.log.Info("Resolving game") return false
err := a.responder.Resolve(ctx) }
if err != nil { a.log.Info("Resolving game")
a.log.Error("Failed to resolve the game", "err", err) if err := a.responder.Resolve(ctx); err != nil {
return false a.log.Error("Failed to resolve the game", "err", err)
} return false
return true
} }
return false return true
} }
// 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