Skip to content

Commit

Permalink
Fixes for Core 0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
metalicjames committed Nov 13, 2017
1 parent d85ac04 commit dee4690
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion p2pool/bitcoin/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def check(bitcoind, net):
print >>sys.stderr, " Check failed! Make sure that you're connected to the right bitcoind with --bitcoind-rpc-port!"
raise deferral.RetrySilentlyException()

version_check_result = net.VERSION_CHECK((yield bitcoind.rpc_getinfo())['version'])
version_check_result = net.VERSION_CHECK((yield bitcoind.rpc_getnetworkinfo())['version'])
if version_check_result == True: version_check_result = None # deprecated
if version_check_result == False: version_check_result = 'Coin daemon too old! Upgrade!' # deprecated
if version_check_result is not None:
Expand Down
2 changes: 1 addition & 1 deletion p2pool/bitcoin/networks/bitcoin.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
RPC_PORT = 8332
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
(yield helper.check_genesis_block(bitcoind, '000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f')) and
not (yield bitcoind.rpc_getinfo())['testnet']
not (yield bitcoind.rpc_getblockchaininfo())['testnet']
))
SUBSIDY_FUNC = lambda height: 50*100000000 >> (height + 1)//210000
POW_FUNC = data.hash256
Expand Down
5 changes: 1 addition & 4 deletions p2pool/bitcoin/networks/vertcoin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
P2P_PORT=5889
ADDRESS_VERSION=71
RPC_PORT=5888
RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
'vertcoinaddress' in (yield bitcoind.rpc_help()) and
not (yield bitcoind.rpc_getinfo())['testnet']
))
RPC_CHECK=lambda bitcoind: True
SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//840000
POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('lyra2re2_hash').getPoWHash(data))
BLOCK_PERIOD=150 # s
Expand Down
5 changes: 1 addition & 4 deletions p2pool/bitcoin/networks/vertcoin_testnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
P2P_PORT=15889
ADDRESS_VERSION=74
RPC_PORT=15888
RPC_CHECK=defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
'vertcoinaddress' in (yield bitcoind.rpc_help()) and
(yield bitcoind.rpc_getinfo())['testnet']
))
RPC_CHECK=lambda bitcoind: True
SUBSIDY_FUNC=lambda height: 50*100000000 >> (height + 1)//840000
POW_FUNC=lambda data: pack.IntType(256).unpack(__import__('lyra2re2_hash').getPoWHash(data))
BLOCK_PERIOD=150 # s
Expand Down
6 changes: 3 additions & 3 deletions p2pool/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,9 +688,9 @@ def get_warnings(tracker, best_share, net, bitcoind_getinfo, bitcoind_work_value
'An upgrade is likely necessary. Check http://p2pool.forre.st/ for more information.' % (
majority_desired_version, 100*desired_version_counts[majority_desired_version]/sum(desired_version_counts.itervalues())))

if bitcoind_getinfo['errors'] != '':
if 'This is a pre-release test build' not in bitcoind_getinfo['errors']:
res.append('(from bitcoind) %s' % (bitcoind_getinfo['errors'],))
if bitcoind_getinfo['warnings'] != '':
if 'This is a pre-release test build' not in bitcoind_getinfo['warnings']:
res.append('(from bitcoind) %s' % (bitcoind_getinfo['warnings'],))

version_warning = getattr(net, 'VERSION_WARNING', lambda v: None)(bitcoind_getinfo['version'])
if version_warning is not None:
Expand Down
2 changes: 1 addition & 1 deletion p2pool/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def long():
bitcoind_getinfo_var = variable.Variable(None)
@defer.inlineCallbacks
def poll_warnings():
bitcoind_getinfo_var.set((yield deferral.retry('Error while calling getinfo:')(bitcoind.rpc_getinfo)()))
bitcoind_getinfo_var.set((yield deferral.retry('Error while calling getnetworkinfo:')(bitcoind.rpc_getnetworkinfo)()))
yield poll_warnings()
deferral.RobustLoopingCall(poll_warnings).start(20*60)

Expand Down

0 comments on commit dee4690

Please sign in to comment.