Fix for miners disconnecting. Jobs are broadcasted at least every 30 seconds.
This commit is contained in:
parent
6a0f7c7d70
commit
4a088b19fc
@ -299,6 +299,8 @@ var StratumServer = exports.Server = function StratumServer(ports, connectionTim
|
|||||||
var stratumClients = {};
|
var stratumClients = {};
|
||||||
var subscriptionCounter = SubscriptionCounter();
|
var subscriptionCounter = SubscriptionCounter();
|
||||||
|
|
||||||
|
var rebroadcastTimeout;
|
||||||
|
|
||||||
var bannedIPs = {};
|
var bannedIPs = {};
|
||||||
|
|
||||||
//Interval to look through bannedIPs for old bans and remove them in order to prevent a memory leak
|
//Interval to look through bannedIPs for old bans and remove them in order to prevent a memory leak
|
||||||
@ -373,6 +375,16 @@ var StratumServer = exports.Server = function StratumServer(ports, connectionTim
|
|||||||
client.sendMiningJob(jobParams);
|
client.sendMiningJob(jobParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Some miners will consider the pool dead if it doesn't receive a job at least every 30 seconds.
|
||||||
|
So every time broadcast jobs, we set a timeout to rebroadcast in 30 seconds unless cleared. */
|
||||||
|
clearTimeout(rebroadcastTimeout);
|
||||||
|
rebroadcastTimeout = setTimeout(function(){
|
||||||
|
console.log('resent jobs');
|
||||||
|
var resendParams = jobParams;
|
||||||
|
resendParams[8] = false;
|
||||||
|
_this.broadcastMiningJobs(resendParams);
|
||||||
|
}, 30000);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getStratumClients = function () {
|
this.getStratumClients = function () {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user