From 473322c72f2d27fe27e7f9bd173d9f16cf51f7cf Mon Sep 17 00:00:00 2001 From: Matt Culpepper Date: Sat, 12 Apr 2014 23:29:57 -0500 Subject: [PATCH 1/4] handle x11 difficulty for mpos compatibility --- libs/mposCompatibility.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/mposCompatibility.js b/libs/mposCompatibility.js index 26b30a2..bc2ae02 100644 --- a/libs/mposCompatibility.js +++ b/libs/mposCompatibility.js @@ -66,9 +66,9 @@ module.exports = function(logger, poolConfig){ var dbData = [ shareData.ip, shareData.worker, - isValidShare ? 'Y' : 'N', + isValidShare ? 'Y' : 'N', isValidBlock ? 'Y' : 'N', - shareData.difficulty, + poolConfig.coin.algorithm === 'x11' ? shareData.difficulty * 256 : shareData.difficulty, typeof(shareData.error) === 'undefined' ? null : shareData.error, shareData.blockHash ? shareData.blockHash : (shareData.blockHashInvalid ? shareData.blockHashInvalid : '') ]; From 35ab95608a3ca6346b95ea8872405ecf8d168613 Mon Sep 17 00:00:00 2001 From: Alex Petrov Date: Sun, 13 Apr 2014 08:48:09 -0400 Subject: [PATCH 2/4] new coins trc,zet,bte,uno --- coins/bytecoin.json | 5 +++++ coins/terracoin.json | 5 +++++ coins/unobtanium.json | 5 +++++ coins/zetacoin.json | 5 +++++ 4 files changed, 20 insertions(+) create mode 100644 coins/bytecoin.json create mode 100644 coins/terracoin.json create mode 100644 coins/unobtanium.json create mode 100644 coins/zetacoin.json diff --git a/coins/bytecoin.json b/coins/bytecoin.json new file mode 100644 index 0000000..45f1b18 --- /dev/null +++ b/coins/bytecoin.json @@ -0,0 +1,5 @@ +{ + "name": "Bytecoin", + "symbol": "BTE", + "algorithm": "sha256" +} diff --git a/coins/terracoin.json b/coins/terracoin.json new file mode 100644 index 0000000..2a72866 --- /dev/null +++ b/coins/terracoin.json @@ -0,0 +1,5 @@ +{ + "name": "Terracoin", + "symbol": "TRC", + "algorithm": "sha256" +} diff --git a/coins/unobtanium.json b/coins/unobtanium.json new file mode 100644 index 0000000..13b4de8 --- /dev/null +++ b/coins/unobtanium.json @@ -0,0 +1,5 @@ +{ + "name": "Unobtanium", + "symbol": "UNO", + "algorithm": "sha256" +} diff --git a/coins/zetacoin.json b/coins/zetacoin.json new file mode 100644 index 0000000..e7515af --- /dev/null +++ b/coins/zetacoin.json @@ -0,0 +1,5 @@ +{ + "name": "Zetacoin", + "symbol": "ZTC", + "algorithm": "sha256" +} From 7b6044d674a220a17066c6ee5552ddeab092a2fc Mon Sep 17 00:00:00 2001 From: Matt Culpepper Date: Sun, 13 Apr 2014 13:59:19 -0500 Subject: [PATCH 3/4] create a config option for difficulty multiplier --- README.md | 1 + coins/darkcoin.json | 5 +++-- coins/hirocoin.json | 5 +++-- libs/mposCompatibility.js | 4 ++-- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index baa047b..fd11497 100644 --- a/README.md +++ b/README.md @@ -243,6 +243,7 @@ Here is an example of the required fields: "symbol": "ltc", "algorithm": "scrypt", //or "sha256", "scrypt-jane", "scrypt-n", "quark", "x11" "txMessages": false, //or true (not required, defaults to false) + "mposDiffMultiplier": 256, //only for x11 coins in mpos mode, set to 256 (optional) } ```` diff --git a/coins/darkcoin.json b/coins/darkcoin.json index ed863c3..fa806d4 100644 --- a/coins/darkcoin.json +++ b/coins/darkcoin.json @@ -1,5 +1,6 @@ { "name": "Darkcoin", "symbol": "DRK", - "algorithm": "x11" -} \ No newline at end of file + "algorithm": "x11", + "mposDiffMultiplier": 256 +} diff --git a/coins/hirocoin.json b/coins/hirocoin.json index 3b21d84..cd7da82 100644 --- a/coins/hirocoin.json +++ b/coins/hirocoin.json @@ -1,5 +1,6 @@ { "name": "Hirocoin", "symbol": "hic", - "algorithm": "x11" -} \ No newline at end of file + "algorithm": "x11", + "mposDiffMultiplier": 256 +} diff --git a/libs/mposCompatibility.js b/libs/mposCompatibility.js index bc2ae02..d0bf31c 100644 --- a/libs/mposCompatibility.js +++ b/libs/mposCompatibility.js @@ -68,7 +68,7 @@ module.exports = function(logger, poolConfig){ shareData.worker, isValidShare ? 'Y' : 'N', isValidBlock ? 'Y' : 'N', - poolConfig.coin.algorithm === 'x11' ? shareData.difficulty * 256 : shareData.difficulty, + shareData.difficulty * (poolConfig.coin.mposDiffMultiplier || 1) typeof(shareData.error) === 'undefined' ? null : shareData.error, shareData.blockHash ? shareData.blockHash : (shareData.blockHashInvalid ? shareData.blockHashInvalid : '') ]; @@ -102,4 +102,4 @@ module.exports = function(logger, poolConfig){ }; -}; \ No newline at end of file +}; From 2d6470cf3f74ae43423a6bce1d85133a69bcc934 Mon Sep 17 00:00:00 2001 From: Matt Culpepper Date: Sun, 13 Apr 2014 14:06:24 -0500 Subject: [PATCH 4/4] missing comma --- libs/mposCompatibility.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/mposCompatibility.js b/libs/mposCompatibility.js index d0bf31c..2ee3f19 100644 --- a/libs/mposCompatibility.js +++ b/libs/mposCompatibility.js @@ -68,7 +68,7 @@ module.exports = function(logger, poolConfig){ shareData.worker, isValidShare ? 'Y' : 'N', isValidBlock ? 'Y' : 'N', - shareData.difficulty * (poolConfig.coin.mposDiffMultiplier || 1) + shareData.difficulty * (poolConfig.coin.mposDiffMultiplier || 1), typeof(shareData.error) === 'undefined' ? null : shareData.error, shareData.blockHash ? shareData.blockHash : (shareData.blockHashInvalid ? shareData.blockHashInvalid : '') ];