Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- onishin
- var hashratess = result.map(function(item){
- var parts = item.split(':');
- var time_reg = parseInt(parts[2]);
- var time_reduc = Math.round(parts[2] / 1000 ) ;
- if ( ( time_reg % 1000 ) != 333 ) {
- redis_multi.push(['zrem', config.coin + ':hashrate' , item]);
- var v = newhashrate[parts[1]] ;
- if (v === undefined) newhashrate[parts[1]] = {};
- newhashrate[parts[1]][time_reduc] = ( newhashrate[parts[1]][time_reduc] || 0 ) + parseInt(parts[0]) ;
- i++;
- }
- });
- log('info', logSystem, 'Continue compresse hash create table for zadd');
- for ( var addr in newhashrate){
- for ( var timeshort in newhashrate[addr] ){
- redis_multi.push(['zadd', config.coin + ':hashrate' , ( timeshort ) , [ newhashrate[addr][timeshort] , addr, ( ( timeshort * 1000 ) + 333 ) ].join(':') ]);
- };
- };
- var redisCommands = [
- ['hincrby', config.coin + ':shares:roundCurrent', miner.login, job.score],
- - ['zadd', config.coin + ':hashrate', dateNowSeconds, [job.difficulty, miner.login, dateNow].join(':')],
- ['hincrby', config.coin + ':workers:' + miner.login, 'hashes', job.difficulty],
- - ['hset', config.coin + ':workers:' + miner.login, 'lastShare', dateNowSeconds]
- ];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement