From aca0ebf0463b57a5e9c142f9231a556fdd885df0 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Tue, 3 Dec 2024 12:47:58 -0800 Subject: [PATCH] Remove console logging. Remove deprecated CPU-based pow code. --- src/lib/pow.ts | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/lib/pow.ts b/src/lib/pow.ts index 24489d4..1c67600 100644 --- a/src/lib/pow.ts +++ b/src/lib/pow.ts @@ -19,7 +19,6 @@ const p = () => { postMessage(new ArrayBuffer(0)) } else { find(d.hash, d.threshold ?? SEND_THRESHOLD).then(nonce => { - console.log(`pow found: ${nonce}`) d.work = nonce const buf = new TextEncoder().encode(JSON.stringify(data)).buffer //@ts-expect-error @@ -30,26 +29,9 @@ const p = () => { }) async function find (hash: string, threshold: string = SEND_THRESHOLD): Promise { - console.log(`hash: ${hash}`) return new Promise(resolve => { - calculate(hash, resolve, console.log, threshold) + calculate(hash, resolve, undefined, threshold) }) - // let result = null - // let count = 0 - // do { - // count++ - // const nonce: Uint8Array = new Uint8Array(NONCE_BYTES) - // crypto.getRandomValues(nonce) - // const test: string = new Blake2b(NONCE_BYTES) - // .update(nonce) - // .update(parseHex(hash)) - // .digest('hex') as string - // if (count % 1000 === 0) console.log(`${count} hashes...`) - // if (BigInt(`0x${test}`) >= BigInt(`0x${threshold}`)) { - // result = nonce - // } - // } while (result == null) - // return result } /** -- 2.34.1