From bcda5441b48c391e18b8e5ceefeb1a4d76c83b78 Mon Sep 17 00:00:00 2001 From: Forrest Voight Date: Sun, 16 Dec 2012 12:02:25 -0500 Subject: [PATCH] fixed block height decoding failing when coinbase doesn't contain it --- p2pool/web.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/p2pool/web.py b/p2pool/web.py index 48d0139..1843858 100644 --- a/p2pool/web.py +++ b/p2pool/web.py @@ -224,7 +224,7 @@ def get_web_root(wb, datadir_path, bitcoind_warning_var, stop_event=variable.Eve web_root.putChild('recent_blocks', WebInterface(lambda: [dict( ts=s.timestamp, hash='%064x' % s.header_hash, - number=pack.IntType(24).unpack(s.share_data['coinbase'][1:4]), + number=pack.IntType(24).unpack(s.share_data['coinbase'][1:4]) if len(s.share_data['coinbase']) >= 4 else None, share='%064x' % s.hash, ) for s in node.tracker.get_chain(node.best_share_var.value, min(node.tracker.get_height(node.best_share_var.value), 24*60*60//node.net.SHARE_PERIOD)) if s.pow_hash <= s.header['bits'].target])) web_root.putChild('uptime', WebInterface(lambda: time.time() - start_time)) -- 1.7.1