diff --git a/lib/pool.js b/lib/pool.js index 953c366..428681c 100644 --- a/lib/pool.js +++ b/lib/pool.js @@ -287,23 +287,27 @@ var pool = module.exports = function pool(options, authorizeFn){ util.script_to_address(results.addressInfo.address) : util.script_to_pubkey(results.addressInfo.pubkey); - var networkDifficulty = Math.round(results.miningInfo.difficulty * 65536); + //var networkDifficulty = Math.round(results.miningInfo.difficulty * 65536); - emitLog('network', 'Current block height at ' + results.miningInfo.blocks + - ' with block difficulty of ' + networkDifficulty); - - Object.keys(options.ports).forEach(function(port){ - var portDiff = options.ports[port].diff; - if (portDiff > networkDifficulty) - emitWarningLog('system', 'diff of ' + portDiff + ' on port ' + port + ' was set higher' + - 'than network difficulty of ' + networkDifficulty); - }); GetBlockTemplate(newDaemon, function(error, result){ if (error) { emitErrorLog('system', 'Error with getblocktemplate on initializing'); cback(error); } else { + + var networkDifficulty = _this.jobManager.currentJob.difficulty; + emitLog('network', 'Current block height at ' + results.miningInfo.blocks + + ' with block difficulty of ' + networkDifficulty); + + Object.keys(options.ports).forEach(function(port){ + var portDiff = options.ports[port].diff; + if (portDiff > networkDifficulty) + emitWarningLog('system', 'diff of ' + portDiff + ' on port ' + port + + ' was set higher than network difficulty of ' + networkDifficulty); + }); + + cback(null, newDaemon); // finish! } });