()
| 179 | } |
| 180 | |
| 181 | func (sp *SmartPool) actOnTick() { |
| 182 | defer func() { |
| 183 | if r := recover(); r != nil { |
| 184 | smartpool.Output.Printf("Recovered in actOnTick: %v\n", r) |
| 185 | debug.PrintStack() |
| 186 | } |
| 187 | }() |
| 188 | var err error |
| 189 | for _ = range sp.ticker { |
| 190 | _, err = sp.Submit() |
| 191 | if err != nil && err.Error() == "client update required" { |
| 192 | smartpool.Output.Printf("Your SmartPool client is too old. Please update to new version by going to https://github.com/SmartPool/smartpool-client.\n") |
| 193 | } |
| 194 | if err != nil && err.Error() == "contract update required" { |
| 195 | smartpool.Output.Printf( |
| 196 | "We deployed new contract at %s. Please restart SmartPool client with --spcontract %s.\n", |
| 197 | sp.PoolMonitor.ContractAddress().Hex(), |
| 198 | sp.PoolMonitor.ContractAddress().Hex()) |
| 199 | } |
| 200 | if sp.shouldStop(err) { |
| 201 | smartpool.Output.Printf("SmartPool stopped. If you want SmartPool to keep running, please use \"--no-hot-stop\" to disable Hot Stop mode.\n") |
| 202 | break |
| 203 | } |
| 204 | } |
| 205 | os.Exit(1) |
| 206 | } |
| 207 | |
| 208 | // Run can be called at most once to start a loop to submit and verify claims |
| 209 | // after an interval. |
no test coverage detected