Added POS/POW Check

This commit is contained in:
root 2013-12-27 21:44:36 +00:00
parent 7ff4cadd8e
commit 8c10f572e1

View File

@ -44,19 +44,16 @@ def setup(on_startup):
if isinstance(result, dict): if isinstance(result, dict):
# litecoind implements version 1 of getblocktemplate # litecoind implements version 1 of getblocktemplate
if result['version'] >= 1: if result['version'] >= 1:
break result = (yield bitcoin_rpc.getinfo())
while True: if isinstance(result,dict):
try: if 'stake' in result and settings.COINDAEMON_Reward == 'POS':
result = (yield bitcoin_rpc.getinfo()) break
if isinstance(result,dict): #elif 'stake' is not in result and settings.COINDAEMON_Reward == 'POW':
if 'stake' in result and settings.COINDAEMON_Reward == 'POS': elif result.has_key('stake') and settings.COINDAEMON_Reward == 'POW':
break break
#elif 'stake' is not in result and settings.COINDAEMON_Reward == 'POW': else:
elif result.has_key('stake') and settings.COINDAEMON_Reward == 'POW': log.error("Wrong Algo Selected, Switch to appropriate POS/POW in config.py!")
break reactor.stop()
else:
log.error("Wrong Algo Selected, Switch to appropriate POS/POW in config.py!")
reactor.stop()
else: else:
log.error("Block Version mismatch: %s" % result['version']) log.error("Block Version mismatch: %s" % result['version'])