Update local_comms.js

fix for #145
This commit is contained in:
MineMoneroPRO
2017-11-10 00:18:47 +03:00
committed by GitHub
parent b9669b8f18
commit b48bd95c8b
+5 -1
View File
@@ -581,11 +581,15 @@ function Database(){
let oldestLockedBlock = this.getOldestLockedBlock(); let oldestLockedBlock = this.getOldestLockedBlock();
async.waterfall([ async.waterfall([
function(callback){ function(callback){
if (oldestLockedBlock === null) {
callback(null, oldestLockedBlock)
} else {
global.coinFuncs.getBlockHeaderByHash(oldestLockedBlock.hash, (err, result) => { global.coinFuncs.getBlockHeaderByHash(oldestLockedBlock.hash, (err, result) => {
oldestLockedBlock.height = result.height; oldestLockedBlock.height = result.height;
console.log(`Got the oldest block`); console.log(Got the oldest block);
callback(null, oldestLockedBlock); callback(null, oldestLockedBlock);
}); });
}
}, },
function(oldestLockedBlock, callback){ function(oldestLockedBlock, callback){
global.coinFuncs.getLastBlockHeader(function(err, body){ global.coinFuncs.getLastBlockHeader(function(err, body){