From ec3b24d96ea47c93eda63ea2b6bfebda594d5c72 Mon Sep 17 00:00:00 2001 From: Forrest Voight Date: Wed, 7 Mar 2012 00:34:02 -0500 Subject: [PATCH] improved share explorer jumping --- p2pool/web.py | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/p2pool/web.py b/p2pool/web.py index b8348e8..1f266ac 100644 --- a/p2pool/web.py +++ b/p2pool/web.py @@ -238,7 +238,13 @@ def get_web_root(tracker, current_work, current_work2, get_current_txouts, datad format_bits = lambda bits: '%f (bits=%#8x) Work required: %sH

' % (bitcoin_data.target_to_difficulty(bits.target), bits.bits, math.format(bitcoin_data.target_to_average_attempts(bits.target))) request.write('

Share %s

' % (share.hash, p2pool_data.format_hash(share.hash))) - request.write('

Previous: %s

' % (share.previous_hash, p2pool_data.format_hash(share.previous_hash))) + if share.previous_hash is not None: + request.write('

Previous: %s' % (share.previous_hash, p2pool_data.format_hash(share.previous_hash))) + if tracker.get_height(share.hash) >= 100: + jump_hash = tracker.get_nth_parent_hash(share.hash, 100) + if jump_hash is not None: + request.write(' (100 jump %s)' % (jump_hash, p2pool_data.format_hash(jump_hash))) + request.write('

') request.write('

Next: %s

' % (', '.join('%s' % (next, p2pool_data.format_hash(next)) for next in sorted(tracker.reverse_shares.get(share.hash, set()), key=lambda sh: -len(tracker.reverse_shares.get(sh, set())))),)) request.write('

Verified: %s

' % (share.hash in tracker.verified.shares,)) request.write('

Time first seen: %s

' % (time.ctime(start_time if share.time_seen == 0 else share.time_seen),)) -- 1.7.1