Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions lib/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down Expand Up @@ -413,15 +413,19 @@ 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;
}

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);
}
Expand Down Expand Up @@ -701,4 +705,4 @@ var pool = module.exports = function pool(options, authorizeFn){
};

};
pool.prototype.__proto__ = events.EventEmitter.prototype;
pool.prototype.__proto__ = events.EventEmitter.prototype;
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
Expand Down