Skip to content

Commit

Permalink
Validate worker args
Browse files Browse the repository at this point in the history
  • Loading branch information
harryttd committed Sep 28, 2023
1 parent 3b0fa05 commit 5b68507
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/powWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ const sha256 = async (input: string) => {
self.addEventListener("message", async ({ data }) => {
try {
const { challenge, difficulty } = data
if (!challenge || !difficulty) {
throw new Error("No challenge or difficulty provided")
}

let nonce = 0
let solution = ""

Expand Down

0 comments on commit 5b68507

Please sign in to comment.