Skip to content

Commit

Permalink
Update worker.js
Browse files Browse the repository at this point in the history
  • Loading branch information
sys-256 authored Jul 5, 2021
1 parent 4e3be9a commit 6081e5a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions worker.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
//imports the sha1 hex library
importScripts("hashes.js");

//when the main script send a message (it passes the username and rigid), this will get executed
onmessage = function (event)
{
//gets the username out of the send data and puts it in the variable "username"
var username = event.data.username;
//sets usernameRecieved to true
var usernameRecieved = true;
//gets the rigid out of the send data and puts it in the variable "rigid"
var rigid = event.data.rigid;
//sets rigedRecieved to true
var rigidRecieved = true;

//if usernameRecieved and rigidRecieved are both true, this will get executed aka it makes a connection with the server and starts mining
if (usernameRecieved && rigidRecieved)
{
//makes a connection with the server
Expand Down

0 comments on commit 6081e5a

Please sign in to comment.