mirror of
https://github.com/jwinterm/nodejs-pool.git
synced 2026-12-01 11:43:58 +01:00
Fix for the 300 msec template bug identified by Mayday30. Thanks for the catch!
This commit is contained in:
+7
-7
@@ -171,11 +171,10 @@ function templateUpdate(repeating) {
|
|||||||
newBlockTemplate(rpcResponse);
|
newBlockTemplate(rpcResponse);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (repeating !== false) {
|
} else {
|
||||||
|
if (repeating !== true) {
|
||||||
setTimeout(templateUpdate, 300);
|
setTimeout(templateUpdate, 300);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
setTimeout(templateUpdate, 300, false);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -644,14 +643,14 @@ function processShare(miner, job, blockTemplate, params) {
|
|||||||
console.error(threadName + "Error submitting block at height " + job.height + " from " + miner.logString + ", share type: " + shareType + " error: " + JSON.stringify(rpcResult.error));
|
console.error(threadName + "Error submitting block at height " + job.height + " from " + miner.logString + ", share type: " + shareType + " error: " + JSON.stringify(rpcResult.error));
|
||||||
recordShareData(miner, job, hashDiff.toString(), false, null, shareType);
|
recordShareData(miner, job, hashDiff.toString(), false, null, shareType);
|
||||||
// Error on submit, so we'll submit a sanity check for good measure.
|
// Error on submit, so we'll submit a sanity check for good measure.
|
||||||
templateUpdate(false);
|
templateUpdate();
|
||||||
} else if (rpcResult) {
|
} else if (rpcResult) {
|
||||||
//Success! Submitted a block without an issue.
|
//Success! Submitted a block without an issue.
|
||||||
let blockFastHash = global.coinFuncs.getBlockID(shareBuffer).toString('hex');
|
let blockFastHash = global.coinFuncs.getBlockID(shareBuffer).toString('hex');
|
||||||
console.log(threadName + "Block " + blockFastHash.substr(0, 6) + " found at height " + job.height + " by " + miner.logString +
|
console.log(threadName + "Block " + blockFastHash.substr(0, 6) + " found at height " + job.height + " by " + miner.logString +
|
||||||
", share type: " + shareType + " - submit result: " + JSON.stringify(rpcResult.result));
|
", share type: " + shareType + " - submit result: " + JSON.stringify(rpcResult.result));
|
||||||
recordShareData(miner, job, hashDiff.toString(), true, blockFastHash, shareType, blockTemplate);
|
recordShareData(miner, job, hashDiff.toString(), true, blockFastHash, shareType, blockTemplate);
|
||||||
templateUpdate(false);
|
templateUpdate();
|
||||||
} else {
|
} else {
|
||||||
// RPC bombed out massively.
|
// RPC bombed out massively.
|
||||||
console.error(threadName + "RPC Error. Please check logs for details");
|
console.error(threadName + "RPC Error. Please check logs for details");
|
||||||
@@ -856,14 +855,15 @@ if (cluster.isMaster) {
|
|||||||
workerList.push(worker);
|
workerList.push(worker);
|
||||||
});
|
});
|
||||||
templateUpdate();
|
templateUpdate();
|
||||||
|
setInterval(templateUpdate, 300, true);
|
||||||
global.support.sendEmail(global.config.general.adminEmail, "Pool server " + global.config.hostname + " online", "The pool server: " + global.config.hostname + " with IP: " + global.config.bind_ip + " is online");
|
global.support.sendEmail(global.config.general.adminEmail, "Pool server " + global.config.hostname + " online", "The pool server: " + global.config.hostname + " with IP: " + global.config.bind_ip + " is online");
|
||||||
} else {
|
} else {
|
||||||
setInterval(checkAliveMiners, 30000);
|
setInterval(checkAliveMiners, 30000);
|
||||||
setInterval(retargetMiners, global.config.pool.retargetTime * 1000);
|
setInterval(retargetMiners, global.config.pool.retargetTime * 1000);
|
||||||
templateUpdate(false);
|
templateUpdate();
|
||||||
setInterval(function () {
|
setInterval(function () {
|
||||||
bannedIPs = [];
|
bannedIPs = [];
|
||||||
templateUpdate(false);
|
templateUpdate();
|
||||||
}, 60000);
|
}, 60000);
|
||||||
async.each(global.config.ports, function (portData) {
|
async.each(global.config.ports, function (portData) {
|
||||||
if (global.config[portData.portType].enable !== true) {
|
if (global.config[portData.portType].enable !== true) {
|
||||||
|
|||||||
Reference in New Issue
Block a user