Skip to content

Commit

Permalink
Update shareProcessor.js
Browse files Browse the repository at this point in the history
  • Loading branch information
hellcatz authored Jan 14, 2023
1 parent 6649934 commit 832235f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions libs/shareProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,17 @@ module.exports = function(logger, poolConfig){
redisCommands.push(['zadd', coin + ':hashrate', dateNow / 1000 | 0, hashrateData.join(':')]);

if (isValidBlock){
redisCommands.push(['rename', coin + ':shares:roundCurrent', coin + ':shares:round' + shareData.height]);
redisCommands.push(['rename', coin + ':shares:timesCurrent', coin + ':shares:times' + shareData.height]);
redisCommands.push(['sadd', coin + ':blocksPending', [shareData.blockHash, shareData.txHash, shareData.height, shareData.worker, dateNow].join(':')]);
redisCommands.push(['hincrby', coin + ':stats', 'validBlocks', 1]);
if (!shareData.blockOnlyPBaaS) {
redisCommands.push(['rename', coin + ':shares:roundCurrent', coin + ':shares:round' + shareData.height]);
redisCommands.push(['rename', coin + ':shares:timesCurrent', coin + ':shares:times' + shareData.height]);
redisCommands.push(['sadd', coin + ':blocksPending', [shareData.blockHash, shareData.txHash, shareData.height, shareData.worker, dateNow].join(':')]);
redisCommands.push(['hincrby', coin + ':stats', 'validBlocks', 1]);
} else {
// TODO, copy pbaas shares for current round ...
//redisCommands.push(['rename', coin + ':shares:roundCurrent', coin + ':shares:round' + shareData.height]);
//redisCommands.push(['rename', coin + ':shares:timesCurrent', coin + ':shares:times' + shareData.height]);
redisCommands.push(['sadd', coin + ':pbaasPending', [shareData.blockHash, shareData.worker, dateNow].join(':')]);
}
}
else if (shareData.blockHash){
redisCommands.push(['hincrby', coin + ':stats', 'invalidBlocks', 1]);
Expand Down

0 comments on commit 832235f

Please sign in to comment.