From 8c01bea91392dbeb49172e1184d64899719afd5f Mon Sep 17 00:00:00 2001 From: sachaaaaa Date: Tue, 8 Jan 2019 13:56:15 +1100 Subject: [PATCH] variables name consistency and remove superfluous initialisation --- js/util_worker_tasks.js | 4 ++-- libloki/proof-of-work.js | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/js/util_worker_tasks.js b/js/util_worker_tasks.js index 4e9b873ce..a1310e706 100644 --- a/js/util_worker_tasks.js +++ b/js/util_worker_tasks.js @@ -41,6 +41,6 @@ function stringToArrayBufferBase64(string) { function arrayBufferToStringBase64(arrayBuffer) { return dcodeIO.ByteBuffer.wrap(arrayBuffer).toString('base64'); } -function calcPoW(timestamp, ttl, pubKey, data, development, nonceTrial = undefined, increment = 1, nonceStartValue = 0) { - return pow.calcPoW(timestamp, ttl, pubKey, data, development, nonceTrial, increment, nonceStartValue); +function calcPoW(timestamp, ttl, pubKey, data, development, nonceTrials = undefined, increment = 1, startNonce = 0) { + return pow.calcPoW(timestamp, ttl, pubKey, data, development, nonceTrials, increment, startNonce); } diff --git a/libloki/proof-of-work.js b/libloki/proof-of-work.js index 0fbc8d28a..074ba3889 100644 --- a/libloki/proof-of-work.js +++ b/libloki/proof-of-work.js @@ -80,7 +80,6 @@ const pow = { await crypto.subtle.digest('SHA-512', payload) ); const innerPayload = new Uint8Array(initialHash.length + NONCE_LEN); - innerPayload.set(nonce); innerPayload.set(initialHash, NONCE_LEN); let resultHash; let nextNonce = nonce;