From db9e7cd3e6f643b3ee31063ef3aef60902adb36b Mon Sep 17 00:00:00 2001 From: Paul Georgiou Date: Sat, 4 Jun 2016 01:36:48 +0300 Subject: [PATCH] Recognize dictionaries and lists of softforks --- p2pool/bitcoin/helper.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/p2pool/bitcoin/helper.py b/p2pool/bitcoin/helper.py index 5d6ce73b2..ecd6e366b 100644 --- a/p2pool/bitcoin/helper.py +++ b/p2pool/bitcoin/helper.py @@ -22,8 +22,12 @@ def check(bitcoind, net): raise deferral.RetrySilentlyException() try: - softforks_supported = set(item['id'] for item in (yield bitcoind.rpc_getblockchaininfo()).get('softforks', [])) - softforks_supported |= set(item['id'] for item in (yield bitcoind.rpc_getblockchaininfo()).get('bip9_softforks', [])) + blockchaininfo = yield bitcoind.rpc_getblockchaininfo() + softforks_supported = set(item['id'] for item in blockchaininfo.get('softforks', [])) + try: + softforks_supported |= set(item['id'] for item in blockchaininfo.get('bip9_softforks', [])) + except TypeError: # https://github.com/bitcoin/bitcoin/pull/7863 + softforks_supported |= set(item for item in blockchaininfo.get('bip9_softforks', [])) except jsonrpc.Error_for_code(-32601): # Method not found softforks_supported = set() if getattr(net, 'SOFTFORKS_REQUIRED', set()) - softforks_supported: