2017-09-05 15:27:08 +02:00
|
|
|
#!/usr/bin/env python3
|
2012-03-31 12:08:11 +02:00
|
|
|
|
2018-07-11 17:38:47 +02:00
|
|
|
from . import util
|
2013-10-06 12:28:45 +02:00
|
|
|
|
2017-09-07 09:41:21 +02:00
|
|
|
from electrum.network import filter_protocol
|
|
|
|
|
from electrum.blockchain import hash_header
|
2014-02-11 14:08:48 +01:00
|
|
|
|
2014-09-15 14:52:28 +02:00
|
|
|
peers = util.get_peers()
|
2017-09-07 09:41:21 +02:00
|
|
|
peers = filter_protocol(peers, 's')
|
|
|
|
|
|
2015-09-09 20:41:08 +09:00
|
|
|
results = util.send_request(peers, 'blockchain.headers.subscribe', [])
|
2014-03-04 22:31:12 +01:00
|
|
|
|
2015-07-05 23:28:05 +02:00
|
|
|
for n,v in sorted(results.items(), key=lambda x:x[1].get('block_height')):
|
2017-09-07 09:41:21 +02:00
|
|
|
print("%60s"%n, v.get('block_height'), hash_header(v))
|