Fix the second cal to getinfo/getblockchaininfo; Verify version before doing the call.
This commit is contained in:
parent
93645681b0
commit
5e2feb5803
1 changed files with 4 additions and 1 deletions
|
@ -230,7 +230,10 @@ while 1:
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
rpc = AuthServiceProxy(rpc_auth, timeout=rpc_timeout)
|
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
|
should_publish = False
|
||||||
for block_id in range(config["lastprocessed"] + 1, last_block + 1):
|
for block_id in range(config["lastprocessed"] + 1, last_block + 1):
|
||||||
if processBlock(block_id):
|
if processBlock(block_id):
|
||||||
|
|
Loading…
Reference in a new issue