`The worker failed to return last block header. Please verify if the daemon is running properly.`
);
}
rows.forEach(function(row){
if(row.blockID<block.height-3){
global.support.sendEmail(global.config.general.adminEmail,"Pool server behind in blocks","The pool server: "+row.hostname+" with IP: "+row.ip+" is "+(block.height-row.blockID)+" blocks behind");
}
}
return
}
if(!lastBlockCheckIsOk){
lastBlockCheckIsOk=true;
global.support.sendEmail(
global.config.general.adminEmail,
'Quering daemon for last block header is back to normal',
`An warning was sent to you indicating that the the worker failed to return the last block header.
Theissueseemstobesolvednow.`
);
}
constsql='SELECT blockID, hostname, ip FROM pools WHERE last_checkin > DATE_SUB(NOW(), INTERVAL 30 MINUTE)';
global.mysql.query(sql).then(pools=>{
pools.forEach(({blockID,hostname,ip})=>{
if(blockID<block.height-3){
global.support.sendEmail(
global.config.general.adminEmail,
'Pool server is behind in blocks',
`The pool server: ${hostname} with IP: ${ip} is ${(block.height-blockID)} blocks behind.`