From 9c52de91edc558a8ea4e79bfde0bf7e90e1eff77 Mon Sep 17 00:00:00 2001 From: Alexander Blair Date: Thu, 5 Apr 2018 13:58:08 -0700 Subject: [PATCH] Update with cryptonight-hashing for XMR. Thanks to Mayday30/MoneroOcean for updating the CN libs for the Variant hardfork. git pull; npm install; then restart services. --- lib/coins/xmr.js | 7 ++++--- lib/payment_systems/xmr.js | 2 +- package.json | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/coins/xmr.js b/lib/coins/xmr.js index a452111..b51cd2d 100644 --- a/lib/coins/xmr.js +++ b/lib/coins/xmr.js @@ -1,7 +1,7 @@ "use strict"; const bignum = require('bignum'); const cnUtil = require('cryptonote-util'); -const multiHashing = require('multi-hashing'); +const multiHashing = require("cryptonight-hashing"); const crypto = require('crypto'); const debug = require('debug')('coinFuncs'); @@ -162,8 +162,9 @@ function Coin(data){ }; }; - this.cryptoNight = multiHashing.cryptonight; - + this.cryptoNight = function(convertedBlob) { + return multiHashing.cryptonight(convertedBlob, convertedBlob[0] >= 7 ? convertedBlob[0] - 6 : 0); + } } module.exports = Coin; diff --git a/lib/payment_systems/xmr.js b/lib/payment_systems/xmr.js index fe664a9..0a7a1fc 100644 --- a/lib/payment_systems/xmr.js +++ b/lib/payment_systems/xmr.js @@ -304,7 +304,7 @@ let paymentQueue = async.queue(function (paymentDetails, callback) { global.support.rpcWallet(transferFunc, paymentDetails, function (body) { debug("Payment made: " + JSON.stringify(body)); if (body.hasOwnProperty('error')) { - if (body.error.message === "not enough money"){ + if (body.error.message === "not enough money" || body.error.message === "not enough unlocked money"){ console.error("Issue making payments, not enough money, will try later"); if(!extraPaymentRound){ setTimeout(function(){ diff --git a/package.json b/package.json index bbfd876..b3ac489 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ }, "optionalDependencies": { "cryptonote-util": "git://github.com/Snipa22/node-cryptonote-util.git#xmr-Nan-2.0", + "cryptonight-hashing": "git+https://github.com/MoneroOcean/node-cryptonight-hashing.git", "multi-hashing": "git+https://github.com/Snipa22/node-multi-hashing-aesni.git#v0.1" } }