Update to keep the pool from repeatedly hammering the BT check.

This commit is contained in:
Alexander Blair
2017-10-16 09:37:18 -07:00
committed by Alexander Blair
parent ef7bfbac3f
commit cd61a82240
+6 -3
View File
@@ -536,8 +536,11 @@ function Database(){
// Hopping into async, we need the current block height to know where to start our indexing...
async.waterfall([
function(callback){
global.coinFuncs.getLastBlockHeader(function(body){
callback(null, body.height, Math.floor(body.difficulty * 1.5 * global.config.pplns.shareMultiLog));
global.coinFuncs.getLastBlockHeader(function(err, body){
if (err) {
return callback(true, body);
}
return callback(null, body.height, Math.floor(body.difficulty * 1.5 * global.config.pplns.shareMultiLog));
});
},
function (lastBlock, difficulty, callback) {
@@ -586,7 +589,7 @@ function Database(){
callback(null, blockList);
}
], function(err, data){
if (global.config.general.blockCleaner === true){
if (err === null && global.config.general.blockCleaner === true){
if(data.length > 0){
global.database.refreshEnv();
let blockList = global.database.getBlockList();