From: Forrest Voight Date: Wed, 17 Oct 2012 23:39:37 +0000 (-0400) Subject: added block number and link to share to "Blocks found in last day" table X-Git-Tag: 8.0~3 X-Git-Url: https://git.novaco.in/?p=p2pool.git;a=commitdiff_plain;h=71c0303982fedba6a870d8c951a35de7ff9392fe added block number and link to share to "Blocks found in last day" table --- diff --git a/p2pool/web.py b/p2pool/web.py index ec7b461..72badbf 100644 --- a/p2pool/web.py +++ b/p2pool/web.py @@ -13,7 +13,7 @@ from twisted.web import resource, static import p2pool from bitcoin import data as bitcoin_data from . import data as p2pool_data -from util import deferred_resource, graph, math +from util import deferred_resource, graph, math, pack def _atomic_read(filename): try: @@ -216,7 +216,12 @@ def get_web_root(tracker, bitcoind_work, get_current_txouts, datadir_path, net, )))) web_root.putChild('peer_versions', WebInterface(lambda: dict(('%s:%i' % peer.addr, peer.other_sub_version) for peer in p2p_node.peers.itervalues()))) web_root.putChild('payout_addr', WebInterface(lambda: bitcoin_data.pubkey_hash_to_address(my_pubkey_hash, net.PARENT))) - web_root.putChild('recent_blocks', WebInterface(lambda: [dict(ts=s.timestamp, hash='%064x' % s.header_hash) for s in tracker.get_chain(best_share_var.value, min(tracker.get_height(best_share_var.value), 24*60*60//net.SHARE_PERIOD)) if s.pow_hash <= s.header['bits'].target])) + 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]), + share='%064x' % s.hash, + ) for s in tracker.get_chain(best_share_var.value, min(tracker.get_height(best_share_var.value), 24*60*60//net.SHARE_PERIOD)) if s.pow_hash <= s.header['bits'].target])) web_root.putChild('uptime', WebInterface(lambda: time.time() - start_time)) web_root.putChild('stale_rates', WebInterface(lambda: p2pool_data.get_stale_counts(tracker, best_share_var.value, 720, rates=True))) diff --git a/web-static/index.html b/web-static/index.html index bf5c02f..8e7f173 100644 --- a/web-static/index.html +++ b/web-static/index.html @@ -2,6 +2,7 @@ + P2Pool @@ -72,8 +73,10 @@ d3.json('/recent_blocks', function(blocks) { var tr = d3.select('#blocks').selectAll().data(blocks).enter().append('tr'); - tr.append('td').text(function(block){return new Date(1000*block.ts).toString()}) + tr.append('td').text(function(block){return new Date(1000*block.ts).toString()}); + tr.append('td').text(function(block){return block.number}); tr.append('td').append('a').text(function(block){return block.hash}).attr('href', function(block){return currency_info.block_explorer_url_prefix + block.hash}); + tr.append('td').append('a').text('→').attr('href', function(block){return 'share.html#' + block.share}); }); }); @@ -115,7 +118,7 @@

Blocks found in last day:

Note that blocks may have been orphaned from the P2Pool chain and so not be here.

- +
timehash
timenumberhash/explorer linkshare

Payouts if a block were found NOW: