diff --git a/lib/pool.js b/lib/pool.js index e5f52c9d..b8e2dd90 100644 --- a/lib/pool.js +++ b/lib/pool.js @@ -377,7 +377,7 @@ var pool = module.exports = function pool(options, authorizeFn){ if (options.coin.hasGetInfo) { batchRpcCalls.push(['getinfo', []]); } else { - batchRpcCalls.push(['getblockchaininfo', []], ['getnetworkinfo', []]); + batchRpcCalls.push(['getblockchaininfo', []], ['getnetworkinfo', []], ['getaddressinfo', [options.address]]); } _this.daemon.batchCmd(batchRpcCalls, function(error, results){ if (error || !results){ @@ -413,7 +413,7 @@ var pool = module.exports = function pool(options, authorizeFn){ /* POS coins must use the pubkey in coinbase transaction, and pubkey is only given if address is owned by wallet.*/ - if (options.coin.reward === 'POS' && typeof(rpcResults.validateaddress.pubkey) == 'undefined') { + if (options.coin.reward === 'POS' && (typeof(rpcResults.validateaddress.pubkey) == 'undefined' && typeof(rpcResults.getaddressinfo.pubkey) == 'undefined')) { emitErrorLog('The address provided is not from the daemon wallet - this is required for POS coins.'); return; } @@ -421,7 +421,11 @@ var pool = module.exports = function pool(options, authorizeFn){ options.poolAddressScript = (function(){ switch(options.coin.reward){ case 'POS': - return util.pubkeyToScript(rpcResults.validateaddress.pubkey); + if ( typeof(rpcResults.validateaddress.pubkey) == 'undefined' ) { + return util.pubkeyToScript(rpcResults.getaddressinfo.pubkey); + } else { + return util.pubkeyToScript(rpcResults.validateaddress.pubkey); + } case 'POW': return util.addressToScript(rpcResults.validateaddress.address); } @@ -701,4 +705,4 @@ var pool = module.exports = function pool(options, authorizeFn){ }; }; -pool.prototype.__proto__ = events.EventEmitter.prototype; +pool.prototype.__proto__ = events.EventEmitter.prototype; \ No newline at end of file diff --git a/package.json b/package.json index 5da16f90..7fc5e7a8 100644 --- a/package.json +++ b/package.json @@ -12,9 +12,9 @@ "verium", "scrypt" ], - "homepage": "https://github.com/phiten/node-stratum-pool", + "homepage": "https://github.com/mderasse/node-stratum-pool", "bugs": { - "url": "https://github.com/phiten/node-stratum-pool/issues" + "url": "https://github.com/mderasse/node-stratum-pool/issues" }, "license": "GPL-2.0", "author": "Matthew Little", @@ -25,13 +25,13 @@ "main": "lib/index.js", "repository": { "type": "git", - "url": "https://github.com/phiten/node-stratum-pool.git" + "url": "https://github.com/mderasse/node-stratum-pool.git" }, "dependencies": { "async": "^2.5.0", "base58-native": "^0.1.4", "bignum": "0.12.5", - "multi-hashing": "git://github.com/phiten/node-multi-hashing.git" + "multi-hashing": "git://github.com/mderasse/node-multi-hashing.git" }, "engines": { "node": ">=9.5"