mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
Update bitcoind_
Removed dependencies of blockchain.info - so no call to anything else than the local bitcoind
This commit is contained in:
parent
538cdc9359
commit
0988b35389
1 changed files with 6 additions and 8 deletions
|
@ -104,17 +104,15 @@ def main():
|
||||||
raise ValueError("Could not connect to Bitcoin server.")
|
raise ValueError("Could not connect to Bitcoin server.")
|
||||||
|
|
||||||
if request_var in ('transactions', 'block_age'):
|
if request_var in ('transactions', 'block_age'):
|
||||||
block_info = get_json_url('http://blockchain.info/block-height/%d?format=json' %
|
(info, error) = bitcoin.getblockhash(info['blocks'])
|
||||||
info['blocks'])
|
(info, error) = bitcoin.getblock(info)
|
||||||
last_block = block_info['blocks'][0]
|
info['block_age'] = int(time.time()) - info['time']
|
||||||
info['block_age'] = int(time.time()) - last_block['time']
|
info['confirmed'] = len(info['tx'])
|
||||||
info['confirmed'] = len(last_block['tx'])
|
|
||||||
|
|
||||||
if request_var in ('fees', 'transactions'):
|
if request_var in ('fees', 'transactions'):
|
||||||
(memory_pool, error) = bitcoin.getmemorypool()
|
(memory_pool, error) = bitcoin.getrawmempool()
|
||||||
if memory_pool:
|
if memory_pool:
|
||||||
info['fees'] = float(memory_pool['coinbasevalue']) / 1e8 - 50.0
|
info['waiting'] = len(memory_pool)
|
||||||
info['waiting'] = len(memory_pool['transactions'])
|
|
||||||
|
|
||||||
if command == 'autoconf':
|
if command == 'autoconf':
|
||||||
print 'yes'
|
print 'yes'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue