Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

don't start miners if no servers are defined

  • Loading branch information...
commit 4a7cec2411f803587aa0dd790363a1a3cdef00f3 1 parent fa165ee
@m0mchil authored
Showing with 8 additions and 11 deletions.
  1. +1 −5 Switch.py
  2. +7 −6 poclbm.py
View
6 Switch.py
@@ -90,11 +90,7 @@ def updatable_miner(self):
def loop(self):
self.should_stop = False
- if not self.servers:
- print '\nAt least one server is required'
- return
- else:
- self.set_server_index(0)
+ self.set_server_index(0)
while True:
if self.should_stop: return
View
13 poclbm.py
@@ -85,13 +85,14 @@ def socketwrap(family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0):
for miner in BFLMiner.initialize(options):
switch.add_miner(miner)
- for miner in switch.miners:
- miner.start()
-
- if switch.miners:
- switch.loop()
- else:
+ if not switch.servers:
+ print '\nAt least one server is required\n'
+ elif not switch.miners:
print '\nNothing to mine on, exiting\n'
+ else:
+ for miner in switch.miners:
+ miner.start()
+ switch.loop()
except KeyboardInterrupt:
print '\nbye'
finally:
Please sign in to comment.
Something went wrong with that request. Please try again.