Merge remote-tracking branch 'origin/master' into safe_customize
commit
da0f153416
|
@ -80,6 +80,9 @@ Comes with lightweight example front-end script which uses the pool's AJAX API.
|
|||
|
||||
* http://extremepool.org
|
||||
* http://xminingpool.com
|
||||
* http://noclaymorefee.com
|
||||
* http://nicepool.org
|
||||
* https://yaymining.com
|
||||
|
||||
Usage
|
||||
===
|
||||
|
|
|
@ -5,25 +5,8 @@ var apiInterfaces = require('./apiInterfaces.js')(config.daemon, config.wallet,
|
|||
var logSystem = 'unlocker';
|
||||
require('./exceptionWriter.js')(logSystem);
|
||||
|
||||
|
||||
log('info', logSystem, 'Started');
|
||||
|
||||
|
||||
//Use this in payment processing to get block info once batch RPC is supported
|
||||
/*
|
||||
var batchArray = [
|
||||
['getblockheaderbyheight', {height: 21}],
|
||||
['getblockheaderbyheight', {height: 22}],
|
||||
['getblockheaderbyheight', {height: 23
|
||||
}]
|
||||
];
|
||||
|
||||
apiInterfaces.batchRpcDaemon(batchArray, function(error, response){
|
||||
|
||||
});
|
||||
*/
|
||||
|
||||
|
||||
function runInterval(){
|
||||
async.waterfall([
|
||||
|
||||
|
@ -96,7 +79,6 @@ function runInterval(){
|
|||
//Get worker shares for each unlocked block
|
||||
function(blocks, callback){
|
||||
|
||||
|
||||
var redisCommands = blocks.map(function(block){
|
||||
return ['hgetall', config.coin + ':shares:round' + block.height];
|
||||
});
|
||||
|
@ -181,20 +163,24 @@ function runInterval(){
|
|||
|
||||
if (Object.keys(donations).length) {
|
||||
for(var wallet in donations) {
|
||||
var percent = donations[wallet];
|
||||
var percent = donations[wallet] / 100;
|
||||
feePercent += percent;
|
||||
payments[wallet] = block.reward * (percent / 100);
|
||||
payments[wallet] = Math.round(block.reward * percent);
|
||||
log('info', logSystem, 'Block %d donation to %s as %d percent of reward: %d', [block.height, wallet, percent, payments[wallet]]);
|
||||
}
|
||||
}
|
||||
|
||||
var reward = block.reward - (block.reward * feePercent);
|
||||
var reward = Math.round(block.reward - (block.reward * feePercent));
|
||||
|
||||
log('info', logSystem, 'Unlocked %d block with reward %d and donation fee %d. Miners reward: %d', [block.height, block.reward, feePercent, reward]);
|
||||
|
||||
if (block.workerShares) {
|
||||
var totalShares = parseInt(block.shares);
|
||||
Object.keys(block.workerShares).forEach(function (worker) {
|
||||
var percent = block.workerShares[worker] / totalShares;
|
||||
var workerReward = reward * percent;
|
||||
var workerReward = Math.round(reward * percent);
|
||||
payments[worker] = (payments[worker] || 0) + workerReward;
|
||||
log('info', logSystem, 'Block %d payment to %s for %d shares: %d', [block.height, worker, totalShares, payments[worker]]);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -49,4 +49,4 @@ for(var configOption in donationAddresses) {
|
|||
}
|
||||
}
|
||||
|
||||
global.version = "v1.1.2";
|
||||
global.version = "v1.1.4";
|
||||
|
|
|
@ -164,10 +164,7 @@
|
|||
spotRadius: 3,
|
||||
chartRangeMin: 0,
|
||||
drawNormalOnTop: false,
|
||||
tooltipFormat: '<b>{{y}}</b>, {{offset:names}}',
|
||||
tooltipValueLookups: {
|
||||
names: null
|
||||
}
|
||||
tooltipFormat: '<b>{{y}}</b>, {{offset:names}}'
|
||||
};
|
||||
|
||||
var userGraphStat = {
|
||||
|
@ -184,10 +181,7 @@
|
|||
spotRadius: 3,
|
||||
drawNormalOnTop: false,
|
||||
chartRangeMin: 0,
|
||||
tooltipFormat: '<b>{{y}}</b>, {{offset:names}}',
|
||||
tooltipValueLookups: {
|
||||
names: null
|
||||
}
|
||||
tooltipFormat: '<b>{{y}}</b>, {{offset:names}}'
|
||||
},
|
||||
payments: {
|
||||
type: 'line',
|
||||
|
@ -202,10 +196,7 @@
|
|||
spotRadius: 3,
|
||||
drawNormalOnTop: false,
|
||||
chartRangeMin: 0,
|
||||
tooltipFormat: '<b>{{y}}</b>, {{offset:names}}',
|
||||
tooltipValueLookups: {
|
||||
names: null
|
||||
}
|
||||
tooltipFormat: '<b>{{y}}</b>, {{offset:names}}'
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -583,7 +574,7 @@
|
|||
for(var chart in userGraphStat) {
|
||||
if(data['charts'][chart] && data['charts'][chart].length) {
|
||||
var graphData = getGraphData(data['charts'][chart], chart == 'payments');
|
||||
userGraphStat[chart].tooltipValueLookups.names = graphData.names;
|
||||
userGraphStat[chart].tooltipValueLookups = {names: graphData.names};
|
||||
$('[data-chart=user_' + chart + ']').show().find('.chart').sparkline(graphData.values, userGraphStat[chart]);
|
||||
}
|
||||
}
|
||||
|
@ -648,10 +639,11 @@
|
|||
|
||||
for(var graphType in graphData) {
|
||||
if(graphData[graphType].values.length > 1) {
|
||||
currencyGraphStat.tooltipValueLookups.names = graphData[graphType].names;
|
||||
var settings = jQuery.extend({}, currencyGraphStat);
|
||||
settings.tooltipValueLookups = {names: graphData[graphType].names};
|
||||
var $chart = $('[data-chart=' + graphType + '] .chart');
|
||||
$chart.closest('.chartWrap').show();
|
||||
$chart.sparkline(graphData[graphType].values, currencyGraphStat);
|
||||
$chart.sparkline(graphData[graphType].values, settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue