Skip to content

Commit

Permalink
Merge pull request p2pool#367 from TheSin-/master
Browse files Browse the repository at this point in the history
Update to bitcoin 0.15 commands
  • Loading branch information
forrestv authored Dec 21, 2017
2 parents 68f653f + af1b3e0 commit afcb011
Show file tree
Hide file tree
Showing 12 changed files with 14 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']
(yield bitcoind.rpc_getblockchaininfo())['chain'] != 'test'
))
SUBSIDY_FUNC = lambda height: 50*100000000 >> (height + 1)//210000
POW_FUNC = data.hash256
Expand Down
2 changes: 1 addition & 1 deletion p2pool/bitcoin/networks/bitcoin_testnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
RPC_PORT = 18332
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
'bitcoinaddress' in (yield bitcoind.rpc_help()) and
(yield bitcoind.rpc_getinfo())['testnet']
(yield bitcoind.rpc_getblockchaininfo())['chain'] == 'test'
))
SUBSIDY_FUNC = lambda height: 50*100000000 >> (height + 1)//210000
POW_FUNC = data.hash256
Expand Down
2 changes: 1 addition & 1 deletion p2pool/bitcoin/networks/fastcoin.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
RPC_PORT = 9527
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
'fastcoinaddress' in (yield bitcoind.rpc_help()) and
not (yield bitcoind.rpc_getinfo())['testnet']
(yield bitcoind.rpc_getblockchaininfo())['chain'] != 'test'
))
SUBSIDY_FUNC = lambda height: 32*100000000 >> (height + 1)//2592000
POW_FUNC = lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data))
Expand Down
2 changes: 1 addition & 1 deletion p2pool/bitcoin/networks/litecoin.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
RPC_PORT = 9332
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
'litecoinaddress' in (yield bitcoind.rpc_help()) and
not (yield bitcoind.rpc_getinfo())['testnet']
(yield bitcoind.rpc_getblockchaininfo())['chain'] != 'test'
))
SUBSIDY_FUNC = lambda height: 50*100000000 >> (height + 1)//840000
POW_FUNC = lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data))
Expand Down
2 changes: 1 addition & 1 deletion p2pool/bitcoin/networks/litecoin_testnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
RPC_PORT = 19332
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
'litecoinaddress' in (yield bitcoind.rpc_help()) and
(yield bitcoind.rpc_getinfo())['testnet']
(yield bitcoind.rpc_getblockchaininfo())['chain'] == 'test'
))
SUBSIDY_FUNC = lambda height: 50*100000000 >> (height + 1)//840000
POW_FUNC = lambda data: pack.IntType(256).unpack(__import__('ltc_scrypt').getPoWHash(data))
Expand Down
2 changes: 1 addition & 1 deletion p2pool/bitcoin/networks/namecoin.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
RPC_PORT = 8336
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
'namecoinaddress' in (yield bitcoind.rpc_help()) and
not (yield bitcoind.rpc_getinfo())['testnet']
(yield bitcoind.rpc_getblockchaininfo())['chain'] != 'test'
))
SUBSIDY_FUNC = lambda height: 50*100000000 >> (height + 1)//210000
POW_FUNC = data.hash256
Expand Down
2 changes: 1 addition & 1 deletion p2pool/bitcoin/networks/namecoin_testnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
RPC_PORT = 18336
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
'namecoinaddress' in (yield bitcoind.rpc_help()) and
(yield bitcoind.rpc_getinfo())['testnet']
(yield bitcoind.rpc_getblockchaininfo())['chain'] == 'test'
))
SUBSIDY_FUNC = lambda height: 50*100000000 >> (height + 1)//210000
POW_FUNC = data.hash256
Expand Down
2 changes: 1 addition & 1 deletion p2pool/bitcoin/networks/terracoin.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
RPC_PORT = 13332
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
'terracoinaddress' in (yield bitcoind.rpc_help()) and
not (yield bitcoind.rpc_getinfo())['testnet']
(yield bitcoind.rpc_getblockchaininfo())['chain'] != 'test'
))
SUBSIDY_FUNC = lambda height: 20*100000000 >> (height + 1)//1050000
POW_FUNC = data.hash256
Expand Down
2 changes: 1 addition & 1 deletion p2pool/bitcoin/networks/terracoin_testnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
RPC_PORT = 23332
RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue(
'terracoinaddress' in (yield bitcoind.rpc_help()) and
(yield bitcoind.rpc_getinfo())['testnet']
(yield bitcoind.rpc_getblockchaininfo())['chain'] == 'test'
))
SUBSIDY_FUNC = lambda height: 20*100000000 >> (height + 1)//1050000
POW_FUNC = data.hash256
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 getinfo:')(bitcoind.rpc_getnetworkinfo)()))
yield poll_warnings()
deferral.RobustLoopingCall(poll_warnings).start(20*60)

Expand Down

0 comments on commit afcb011

Please sign in to comment.