From 93645681b016eb31b40d89a1ca8399f3d07a1f16 Mon Sep 17 00:00:00 2001 From: rllola Date: Thu, 21 Feb 2019 14:39:58 +0100 Subject: [PATCH 1/2] Use waitfornewblock if namecoin version 16.0 or higher --- plugins/Zeroname/updater/zeroname_updater.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/Zeroname/updater/zeroname_updater.py b/plugins/Zeroname/updater/zeroname_updater.py index 6edb8d12..c2f4b693 100644 --- a/plugins/Zeroname/updater/zeroname_updater.py +++ b/plugins/Zeroname/updater/zeroname_updater.py @@ -216,7 +216,10 @@ while 1: while 1: try: time.sleep(1) - rpc.waitforblock() + if node_version < 160000 : + rpc.waitforblock() + else: + rpc.waitfornewblock() print "Found" break # Block found except socket.timeout: # Timeout From 5e2feb58033181425f793792d807424bda761df9 Mon Sep 17 00:00:00 2001 From: rllola Date: Thu, 21 Feb 2019 16:10:42 +0100 Subject: [PATCH 2/2] Fix the second cal to getinfo/getblockchaininfo; Verify version before doing the call. --- plugins/Zeroname/updater/zeroname_updater.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/Zeroname/updater/zeroname_updater.py b/plugins/Zeroname/updater/zeroname_updater.py index c2f4b693..a8eedd13 100644 --- a/plugins/Zeroname/updater/zeroname_updater.py +++ b/plugins/Zeroname/updater/zeroname_updater.py @@ -230,7 +230,10 @@ while 1: time.sleep(5) rpc = AuthServiceProxy(rpc_auth, timeout=rpc_timeout) - last_block = int(rpc.getinfo()["blocks"]) + if node_version < 160000 : + last_block = int(rpc.getinfo()["blocks"]) + else: + last_block = int(rpc.getblockchaininfo()["blocks"]) should_publish = False for block_id in range(config["lastprocessed"] + 1, last_block + 1): if processBlock(block_id):