From f53ec0dacebba93766e3776a75e1e65d77621fb0 Mon Sep 17 00:00:00 2001 From: uPlexa Date: Mon, 29 Apr 2019 07:01:45 -0400 Subject: [PATCH] Finalize UPXTWO changes --- lib/xmr.js | 5 +++-- package-lock.json | 20 ++++++++++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/lib/xmr.js b/lib/xmr.js index 6133334..e817e95 100644 --- a/lib/xmr.js +++ b/lib/xmr.js @@ -101,7 +101,7 @@ function parse_algo_variant(algo_str, variant) { } function detectAlgo(default_pool_algo_set, block_version) { - if ("cn/2" in default_pool_algo_set && "cn/1" in default_pool_algo_set) return block_version >= 11 ? "cn/2" : "cn/1"; // monero fork + if ("cn-upx/2" in default_pool_algo_set && "cn/1" in default_pool_algo_set) return block_version >= 11 ? "cn/2" : "cn/1"; // monero fork const default_pool_algo_arr = Object.keys(default_pool_algo_set); if (default_pool_algo_arr.length == 1) return default_pool_algo_arr[0]; console.error("Can't not correctly detect block template algorithm from the list of provided default algorithms (please reduce it to single item): " + default_pool_algo_arr.join(", ")); @@ -309,10 +309,11 @@ function processShare(miner, job, blockTemplate, nonce, resultHash) { var hard_fork_version = convertedBlob[0]; hash = multiHashing.cryptonight_upx(convertedBlob, 1); if(hard_fork_version>=11){ - hash = multiHashing.cryptonight(convertedBlob, 8); + hash = multiHashing.cryptonight_plex(convertedBlob); } if (hash.toString('hex') !== resultHash) { console.error(global.threadName + "Bad share from miner " + miner.logString); + console.log("\r\n" + hash.toString('hex') + "\r\n" + resultHash); miner.messageSender('job', miner.getJob(miner, blockTemplate, true)); return false; } diff --git a/package-lock.json b/package-lock.json index 9c2d382..9535bb0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -110,9 +110,12 @@ } }, "bindings": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.1.tgz", - "integrity": "sha512-i47mqjF9UbjxJhxGf+pZ6kSxrnI3wBLlnGI2ArWJ4r0VrvDS7ZYXkprq/pLaBWYq4GM0r4zdHY+NNRqEMU7uew==" + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "requires": { + "file-uri-to-path": "1.0.0" + } }, "block-stream": { "version": "0.0.9", @@ -213,14 +216,14 @@ "cryptoforknote-util": { "version": "git+https://github.com/MoneroOcean/node-cryptoforknote-util.git#473f81f81bc55a1fc4c6f5ce55d1feb9b9cf6f61", "requires": { - "bindings": "1.3.1", + "bindings": "1.5.0", "nan": "2.12.0" } }, "cryptonight-hashing": { - "version": "git+https://github.com/uPlexa/node-cryptonight-hashing.git#7e3f15a33934ace8a471b4f4f8045b86e57b03ae", + "version": "git+https://github.com/uPlexa/node-cryptonight-hashing.git#70bcb3e7844711108ccec37c78cf052edec4b1fe", "requires": { - "bindings": "1.3.1", + "bindings": "1.5.0", "nan": "2.12.0" } }, @@ -379,6 +382,11 @@ "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + }, "finalhandler": { "version": "0.5.0", "resolved": "http://registry.npmjs.org/finalhandler/-/finalhandler-0.5.0.tgz",