Skip to content

Commit

Permalink
Add support of neoscrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
Kukunin committed Dec 23, 2014
1 parent 4f7f0fb commit ce71425
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
8 changes: 8 additions & 0 deletions lib/algoProperties.js
Expand Up @@ -181,6 +181,14 @@ var algos = module.exports = global.algos = {
return multiHashing.qubit.apply(this, arguments);
}
}
},
neoscrypt: {
multiplier: Math.pow(2, 16),
hash: function(){
return function(){
return multiHashing.neoscrypt.apply(this, arguments);
}
}
}
};

Expand Down
7 changes: 6 additions & 1 deletion lib/jobManager.js
Expand Up @@ -230,7 +230,12 @@ var JobManager = module.exports = function JobManager(options){
//Check if share is a block candidate (matched network difficulty)
if (job.target.ge(headerBigNum)){
blockHex = job.serializeBlock(headerBuffer, coinbaseBuffer).toString('hex');
blockHash = blockHasher(headerBuffer, nTime).toString('hex');
if (options.coin.algorithm === 'neoscrypt') {
blockHash = util.reverseBuffer(util.sha256d(headerBuffer, nTime)).toString('hex');
}
else {
blockHash = blockHasher(headerBuffer, nTime).toString('hex');
}
}
else {
if (options.emitInvalidBlockHashes)
Expand Down
5 changes: 3 additions & 2 deletions package.json
Expand Up @@ -10,7 +10,8 @@
"poolserver",
"bitcoin",
"litecoin",
"scrypt"
"scrypt",
"neoscrypt"
],
"homepage": "https://github.com/zone117x/node-stratum-pool",
"bugs": {
Expand All @@ -28,7 +29,7 @@
"url": "https://github.com/zone117x/node-stratum-pool.git"
},
"dependencies": {
"multi-hashing": "git://github.com/zone117x/node-multi-hashing.git",
"multi-hashing": "git://github.com/Kukunin/node-multi-hashing.git",
"bignum": "*",
"base58-native": "*",
"async": "*",
Expand Down

0 comments on commit ce71425

Please sign in to comment.