Skip to content

Commit

Permalink
Merge pull request p2pool#308 from veqtrus/master
Browse files Browse the repository at this point in the history
Recognize dictionaries and lists of softforks
  • Loading branch information
forrestv committed Jun 4, 2016
2 parents 259c383 + db9e7cd commit d3bbd6d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions p2pool/bitcoin/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d3bbd6d

Please sign in to comment.