mirror of
https://github.com/jwinterm/nodejs-pool.git
synced 2026-10-26 05:48:34 +01:00
Update with fixes to finish getting AEON working and to block things from blocking when I don't expect them to.
AEON has a block on the way it does chain saving, which can lock up many portions of the blockManager daemon. This is now patched in blockmanager.
This commit is contained in:
+10
-3
@@ -16,7 +16,10 @@ function updateShareStats() {
|
||||
let activeAddresses = [];
|
||||
async.waterfall([
|
||||
function (callback) {
|
||||
global.coinFuncs.getLastBlockHeader(function (body) {
|
||||
global.coinFuncs.getLastBlockHeader(function (err, body) {
|
||||
if (err !== null){
|
||||
return callback(err, "Invalid block header");
|
||||
}
|
||||
callback(null, body.height + 1);
|
||||
});
|
||||
},
|
||||
@@ -493,8 +496,12 @@ function updateWalletStats() {
|
||||
}
|
||||
|
||||
function monitorNodes() {
|
||||
global.mysql.query("SELECT blockID FROM pools WHERE last_checkin > date_sub(now(), interval 30 minute)").then(function (rows) {
|
||||
global.coinFuncs.getLastBlockHeader(function (block) {
|
||||
global.mysql.query("SELECT blockID, hostname, ip FROM pools WHERE last_checkin > date_sub(now(), interval 30 minute)").then(function (rows) {
|
||||
global.coinFuncs.getLastBlockHeader(function (err, block) {
|
||||
if (err !== null){
|
||||
console.error("Issue in getting block header. Skipping node monitor");
|
||||
return;
|
||||
}
|
||||
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");
|
||||
|
||||
Reference in New Issue
Block a user