From ca31649207ada268ef0f27fa2475be670137c082 Mon Sep 17 00:00:00 2001 From: Beaudan Date: Wed, 12 Jun 2019 17:26:08 +1000 Subject: [PATCH] Trial value wasn't being initialised big enough for very low difficulty, also development should not have been there but I don't think it was doing anything --- js/util_worker_tasks.js | 2 -- libloki/proof-of-work.js | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/js/util_worker_tasks.js b/js/util_worker_tasks.js index b084e7b1a..90fa017cd 100644 --- a/js/util_worker_tasks.js +++ b/js/util_worker_tasks.js @@ -46,7 +46,6 @@ function calcPoW( ttl, pubKey, data, - development, difficulty = undefined, increment = 1, startNonce = 0 @@ -56,7 +55,6 @@ function calcPoW( ttl, pubKey, data, - development, difficulty, increment, startNonce diff --git a/libloki/proof-of-work.js b/libloki/proof-of-work.js index b1359d4e5..c6a3a4b1e 100644 --- a/libloki/proof-of-work.js +++ b/libloki/proof-of-work.js @@ -77,9 +77,7 @@ const pow = { let nonce = new Uint8Array(NONCE_LEN); nonce = pow.incrementNonce(nonce, startNonce); // initial value - let trialValue = pow.bigIntToUint8Array( - JSBI.BigInt(Number.MAX_SAFE_INTEGER) - ); + let trialValue = new Uint8Array([255, 255, 255, 255, 255, 255, 255, 255]); const initialHash = new Uint8Array( await crypto.subtle.digest('SHA-512', payload) );