From c9f4ae808cad75fcd5fd8e96056fd3a11c50d565 Mon Sep 17 00:00:00 2001 From: Alexander Zschach Date: Sat, 22 Feb 2014 21:47:23 +0100 Subject: [PATCH] Fixed payout if a block where found now --- index.html | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/index.html b/index.html index 8bd1981..4265280 100644 --- a/index.html +++ b/index.html @@ -198,7 +198,8 @@

Recent blocks

}); var currency, currency_info, rate, local_stats, - global_stats, current_payouts, recent_blocks; + global_stats, current_payouts, recent_blocks, + payout_addr; var local_hashrate= 0, local_doa_hashrate= 0; var jsonp= "./jsonp.php?callback=?"; @@ -264,6 +265,14 @@

Recent blocks

tr.addClass('warning'); } + // highlight the pool's payout address + payout_addr in current_payouts ? + $('#payout_now') + .text(current_payouts[payout_addr]) + .append(' ') + .append(currency.clone()) : + $('#payout_now').html('&dash'); + address_span= $('').addClass('coin_address').text(address); link_icon= $('').addClass('fa fa-external-link fa-fw'); blockinfo= $('') @@ -366,7 +375,6 @@

Recent blocks

+ ' (Orphan: ' + local_stats.shares.orphan + ', Dead: ' + local_stats.shares.dead + ')'); - if(local_hashrate !== 0) { time_to_share= (parseInt(local_stats.attempts_to_share) / parseInt(local_hashrate)); @@ -379,8 +387,6 @@

Recent blocks

(parseInt(local_stats.attempts_to_block) / parseInt(global_stats.pool_hash_rate)) || 0; $('#expected_time_to_block').text((''+time_to_block).formatSeconds()); - - $('#payout_now').html('‐'); }); // Fills the recent block table @@ -462,10 +468,14 @@

Recent blocks

$.getJSON(api_url + '/current_payouts', function(data) { if(data) current_payouts= data; - $.getJSON(api_url + '/global_stats', function(data) { - if(data) global_stats= data; - $(document).trigger('update_miners'); - $(document).trigger('update_time'); + $.getJSON(api_url + '/payout_addr', function(data) { + if(data) payout_addr= data; + + $.getJSON(api_url + '/global_stats', function(data) { + if(data) global_stats= data; + $(document).trigger('update_miners'); + $(document).trigger('update_time'); + }); }); }); });