From 4ac7f9885e573778064cea6f6d49d067a1a09a60 Mon Sep 17 00:00:00 2001 From: ahmedbodi Date: Fri, 27 Dec 2013 15:39:34 +0100 Subject: [PATCH] POS Check --- mining/__init__.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/mining/__init__.py b/mining/__init__.py index 4af5185..43df9f7 100644 --- a/mining/__init__.py +++ b/mining/__init__.py @@ -45,12 +45,23 @@ def setup(on_startup): # litecoind implements version 1 of getblocktemplate if result['version'] >= 1: break + while True: + try: + result = (yield bitcoin_rpc.getinfo()) + if isinstance(result,dict): + if 'stake' in result and settings.COINDAEMON_Reward = 'POS': + break + elif 'stake' is not in result and settings.COINDAEMON_Reward = 'POW': + break + else: + log.error("Wrong Algo Selected, Switch to POS") + reactor.stop() else: log.error("Block Version mismatch: %s" % result['version']) except ConnectionRefusedError, e: - log.error("Connection refused while trying to connect to litecoin (are your COIND_* settings correct?)") + log.error("Connection refused while trying to connect to the coind (are your COIND_* settings correct?)") reactor.stop() break