MCPcopy
hub / github.com/HelloZeroNet/ZeroNet / last_block_height

Function last_block_height

src/lib/pybitcointools/bci.py:307–315  ·  view source on GitHub ↗
(network='btc')

Source from the content-addressed store, hash-verified

305
306
307def last_block_height(network='btc'):
308 if network == 'testnet':
309 data = make_request('http://tbtc.blockr.io/api/v1/block/info/last')
310 jsonobj = json.loads(data.decode("utf-8"))
311 return jsonobj["data"]["nb"]
312
313 data = make_request('https://blockchain.info/latestblock')
314 jsonobj = json.loads(data.decode("utf-8"))
315 return jsonobj["height"]
316
317
318# Gets a specific transaction

Callers

nothing calls this directly

Calls 1

make_requestFunction · 0.85

Tested by

no test coverage detected