diff --git a/lib/pool.js b/lib/pool.js index be2ef94..781b4ed 100644 --- a/lib/pool.js +++ b/lib/pool.js @@ -36,6 +36,7 @@ var pool = module.exports = function pool(options, authorizeFn){ var emitErrorLog = function(key, text) { _this.emit('log', 'error' , key, text); }; this.start = function(){ + emitLog('system', 'Starting pool for ' + options.name + ' [' + options.symbol.toUpperCase() + ']'); SetupJobManager(); SetupVarDiff(); SetupDaemonInterface(); @@ -203,6 +204,12 @@ var pool = module.exports = function pool(options, authorizeFn){ return b.blocks - a.blocks; })[0]; + if (options.varDiff.enabled) + _this.varDiff.setNetworkDifficulty(largestHeight.difficulty); + + emitLog('network', 'Current block height at ' + largestHeight.blocks + + ' with difficulty of ' + largestHeight.difficulty); + callback(null, largestHeight); } else{ @@ -228,13 +235,10 @@ var pool = module.exports = function pool(options, authorizeFn){ return; } - emitLog('system','Connected to daemon'); + emitLog('system','Connected to daemon via RPC'); options.hasSubmitMethod = results.submitMethod; - if (options.varDiff.enabled) - _this.varDiff.setNetworkDifficulty(results.miningInfo.difficulty); - if (options.reward === 'POS' && typeof(results.addressInfo.pubkey) == 'undefined') { // address provided is not of the wallet. emitErrorLog('system', 'The address provided is not from the daemon wallet.');