Skip to content

Commit

Permalink
Merge pull request #12 from johndoe75/devel
Browse files Browse the repository at this point in the history
Fixed payout if a block where found now
  • Loading branch information
johndoe75 committed Feb 22, 2014
2 parents f6e6488 + c9f4ae8 commit b587645
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ <h4>Recent blocks</h4>
});

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=?";
Expand Down Expand Up @@ -264,6 +265,14 @@ <h4>Recent blocks</h4>
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= $('<span/>').addClass('coin_address').text(address);
link_icon= $('<i/>').addClass('fa fa-external-link fa-fw');
blockinfo= $('<a/>')
Expand Down Expand Up @@ -378,8 +387,6 @@ <h4>Recent blocks</h4>
(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('&dash;');
});

// Fills the recent block table
Expand Down Expand Up @@ -461,10 +468,14 @@ <h4>Recent blocks</h4>
$.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');
});
});
});
});
Expand Down

0 comments on commit b587645

Please sign in to comment.