|
|
|
@ -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();
|
|
|
|
|