From 6f053d3d7b6d5a9179868cd28cceb4e74db07b02 Mon Sep 17 00:00:00 2001 From: dskvr Date: Tue, 24 Sep 2024 01:01:24 +0200 Subject: [PATCH] fix missing event in demo --- demo/main.js | 2 +- demo/worker.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/demo/main.js b/demo/main.js index 8f4bcf4..0bff0a7 100644 --- a/demo/main.js +++ b/demo/main.js @@ -258,7 +258,6 @@ async function handleWorkerMessage(e) { recordHashRate(workerId, hashRate) refreshHashRate() } - if (typeof best_pow === 'number') { minersBestPow[workerId] = { bestPow: best_pow, @@ -386,6 +385,7 @@ function onK3(event){ } catch(e){ console.error('Error parsing K3 content:', e) + console.warn('K3 content:', event.content) } console.log('K3 relays:', relays) diff --git a/demo/worker.js b/demo/worker.js index 7329ed4..57f8377 100644 --- a/demo/worker.js +++ b/demo/worker.js @@ -28,7 +28,6 @@ function destructureMap (map) { self.onmessage = async function (e) { const { type, event, difficulty, workerId, totalWorkers } = e.data; - console.log(e) function reportProgress(hashRate = undefined, bestPow = undefined) { let header = { type: 'progress' } @@ -37,7 +36,7 @@ self.onmessage = async function (e) { } if(bestPow !== null) { const { best_pow, nonce, hash } = destructureMap(bestPow); - postMessage({ ...header, workerId, best_pow, nonce, event }); + postMessage({ ...header, workerId, best_pow, nonce, event, hash }); } }