diff --git a/coins/digibyte.sha256.json b/coins/digibyte.sha256.json index 83dce53e..de42cedb 100644 --- a/coins/digibyte.sha256.json +++ b/coins/digibyte.sha256.json @@ -5,7 +5,8 @@ "peerMagic": "fac3b6da", "version-rolling": true, "allowAsicboost": true, - "version_mask": "0x1fffe0000", + "version_mask": "1fffe000", + "min-bit-count": 16, "coinbase": "DigiHashV2", "getInfo": false, "noNetworkInfo": false, diff --git a/libs/mposCompatibility.js b/libs/mposCompatibility.js index fe2f450f..81e8004b 100644 --- a/libs/mposCompatibility.js +++ b/libs/mposCompatibility.js @@ -79,12 +79,22 @@ module.exports = function(logger, poolConfig){ this.handleShare = function(isValidShare, isValidBlock, shareData){ + var difficulty = shareData.difficulty; + + // Ensure difficulty is not below a certain threshold + if (difficulty < poolConfig.minDiff) { + difficulty = poolConfig.minDiff; + } + + // Log difficulty values for debugging + logger.debug(logIdentify, logComponent, `MPOSCompatibility - Processing share with difficulty: ${difficulty}`); + var dbData = [ shareData.ip, shareData.worker, isValidShare ? 'Y' : 'N', isValidBlock ? 'Y' : 'N', - shareData.difficulty * (poolConfig.coin.mposDiffMultiplier || 1), + difficulty, // Use the adjusted difficulty typeof(shareData.error) === 'undefined' ? null : shareData.error, shareData.blockHash ? shareData.blockHash : (shareData.blockHashInvalid ? shareData.blockHashInvalid : '') ]; diff --git a/libs/shareProcessor.js b/libs/shareProcessor.js index 3d892f85..b2c3985f 100644 --- a/libs/shareProcessor.js +++ b/libs/shareProcessor.js @@ -68,21 +68,24 @@ module.exports = function(logger, poolConfig){ this.handleShare = function(isValidShare, isValidBlock, shareData) { var redisCommands = []; - + + // Log difficulty values for debugging + logger.debug(logSystem, logComponent, `ShareProcessor - Processing share with difficulty: ${shareData.difficulty}`); + if (isValidShare) { redisCommands.push(['hincrbyfloat', coin + ':shares:roundCurrent', shareData.worker, shareData.difficulty]); redisCommands.push(['hincrby', coin + ':stats', 'validShares', 1]); } else { redisCommands.push(['hincrby', coin + ':stats', 'invalidShares', 1]); } - + /* Stores share diff, worker, and unique value with a score that is the timestamp. Unique value ensures it doesn't overwrite an existing entry, and timestamp as score lets us query shares from last X minutes to generate hashrate for each worker and pool. */ var dateNow = Date.now(); var hashrateData = [ isValidShare ? shareData.difficulty : -shareData.difficulty, shareData.worker, dateNow]; 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]); @@ -92,7 +95,7 @@ module.exports = function(logger, poolConfig){ else if (shareData.blockHash){ redisCommands.push(['hincrby', coin + ':stats', 'invalidBlocks', 1]); } - + connection.multi(redisCommands).exec(function(err, replies){ if (err) logger.error(logSystem, logComponent, logSubCat, 'Error with share processor multi ' + JSON.stringify(err)); diff --git a/pool_configs/digibyte.sha256.json b/pool_configs/digibyte.sha256.json index 3130c1db..87cef565 100644 --- a/pool_configs/digibyte.sha256.json +++ b/pool_configs/digibyte.sha256.json @@ -61,8 +61,8 @@ "diff": 2500000, "tls": false, "varDiff": { - "minDiff": 10000, - "maxDiff": 100000000, + "minDiff": 250000, + "maxDiff": 25000000, "targetTime": 15, "retargetTime": 75, "variancePercent": 30