Skip to content

Instantly share code, notes, and snippets.

@jwhitehorn
Created March 5, 2019 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jwhitehorn/0b6ed12251f331b232a38f1e32b318e6 to your computer and use it in GitHub Desktop.
Save jwhitehorn/0b6ed12251f331b232a38f1e32b318e6 to your computer and use it in GitHub Desktop.
this.handleGetWorkResponse = function(response){
var work = eval("(" + response + ")");
var midstate = jsMiner.Util.fromPoolString(work.midstate);
var half = work.data.substring(0, 128);
var data = work.data.substring(128, 256);
data = jsMiner.Util.fromPoolString(data);
half = jsMiner.Util.fromPoolString(half);
var hash1 = jsMiner.Util.fromPoolString(work.hash1);
var target = jsMiner.Util.fromPoolString(work.target);
this.workerEntry(midstate, half, data, hash1, target, work.first_nonce, work.last_nonce);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment