Browse Source

reverted to 10s reconnect

pull/123/head
notgiven688 3 years ago
parent
commit
5773340c7f
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      SDK/miner_compressed/webmr.js
  2. +1
    -1
      SDK/miner_raw/miner/miner.js

+ 1
- 1
SDK/miner_compressed/webmr.js View File

@ -1,5 +1,5 @@
var server="wss://webminerpool.com:8181/",job=null,workers=[],ws,receiveStack=[],sendStack=[],totalhashes=0,connected=0,reconnector=0,attempts=1,throttleMiner=0,handshake=null;function addWorkers(k){logicalProcessors=k;if(-1==k){try{logicalProcessors=window.navigator.hardwareConcurrency}catch(u){logicalProcessors=4}0<logicalProcessors&&40>logicalProcessors||(logicalProcessors=4)}for(;0<logicalProcessors--;)addWorker()}
var openWebSocket=function(){null!=ws&&ws.close();ws=new WebSocket(server);ws.onmessage=on_servermsg;ws.onerror=function(k){2>connected&&(connected=2);job=null};ws.onclose=function(){2>connected&&(connected=2);job=null};ws.onopen=function(){ws.send(JSON.stringify(handshake));connected=attempts=1}};reconnector=function(){3!==connected&&(null==ws||0!==ws.readyState&&1!==ws.readyState)&&(attempts++,openWebSocket());3!==connected&&setTimeout(reconnector,5E3*attempts)};
var openWebSocket=function(){null!=ws&&ws.close();ws=new WebSocket(server);ws.onmessage=on_servermsg;ws.onerror=function(k){2>connected&&(connected=2);job=null};ws.onclose=function(){2>connected&&(connected=2);job=null};ws.onopen=function(){ws.send(JSON.stringify(handshake));connected=attempts=1}};reconnector=function(){3!==connected&&(null==ws||0!==ws.readyState&&1!==ws.readyState)&&(attempts++,openWebSocket());3!==connected&&setTimeout(reconnector,1E4*attempts)};
function startMiningWithId(k,u,q){u=void 0===u?-1:u;q=void 0===q?"":q;stopMining();connected=0;handshake={identifier:"handshake",loginid:k,userid:q,version:5};addWorkers(u);reconnector()}function startMining(k,u,q,C,H){q=void 0===q?"":q;C=void 0===C?-1:C;H=void 0===H?"":H;stopMining();connected=0;handshake={identifier:"handshake",pool:k,login:u,password:q,userid:H,version:5};addWorkers(C);reconnector()}function stopMining(){connected=3;null!=ws&&ws.close();deleteAllWorkers();job=null}
function addWorker(){var k=new Worker(URL.createObjectURL(new Blob(["("+function(){function k(b){x(!Z);var a=y;y=y+b+15&-16;return a}function q(b){x(z);var a=l[z>>2];b=a+b+15&-16;l[z>>2]=b;return b>=A?(Q(),l[z>>2]=a,0):a}function C(b,a){a||(a=16);return Math.ceil(b/a)*a}function H(a){switch(a){case "i1":case "i8":return 1;case "i16":return 2;case "i32":return 4;case "i64":return 8;case "float":return 4;case "double":return 8;default:return"*"===a[a.length-1]?4:"i"===a[0]?(a=parseInt(a.substr(1)),
x(0===a%8),a/8):0}}function x(a,d){a||B("Assertion failed: "+d)}function aa(b){var d=a["_"+b];x(d,"Cannot call unknown function "+b+", make sure it is exported");return d}function ba(a,d,c,e,f){f=aa(a);var b=[];a=0;if(e)for(var g=0;g<e.length;g++){var k=sa[c[g]];k?(0===a&&(a=ca()),b[g]=k(e[g])):b[g]=e[g]}c=f.apply(null,b);"string"===d&&(c=ta(c));0!==a&&da(a);return c}function ta(a,d){if(0===d||!a)return"";for(var b=0,e,f=0;;){e=v[a+f>>0];b|=e;if(0==e&&!d)break;f++;if(d&&f==d)break}d||(d=f);e="";if(128>

+ 1
- 1
SDK/miner_raw/miner/miner.js View File

@ -80,7 +80,7 @@ reconnector = function () {
}
if (connected !== 3)
setTimeout(reconnector, 5000 * attempts);
setTimeout(reconnector, 10000 * attempts);
};
// starts mining

Loading…
Cancel
Save