Skip to content

Commit

Permalink
fix missing event in demo
Browse files Browse the repository at this point in the history
  • Loading branch information
dskvr committed Sep 23, 2024
1 parent 278309b commit 6f053d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion demo/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ async function handleWorkerMessage(e) {
recordHashRate(workerId, hashRate)
refreshHashRate()
}

if (typeof best_pow === 'number') {
minersBestPow[workerId] = {
bestPow: best_pow,
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions demo/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
Expand All @@ -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 });
}
}

Expand Down

0 comments on commit 6f053d3

Please sign in to comment.