parent
b9669b8f18
commit
b48bd95c8b
1 changed files with 11 additions and 7 deletions
|
|
@ -581,12 +581,16 @@ function Database(){
|
|||
let oldestLockedBlock = this.getOldestLockedBlock();
|
||||
async.waterfall([
|
||||
function(callback){
|
||||
global.coinFuncs.getBlockHeaderByHash(oldestLockedBlock.hash, (err, result) => {
|
||||
oldestLockedBlock.height = result.height;
|
||||
console.log(`Got the oldest block`);
|
||||
callback(null, oldestLockedBlock);
|
||||
});
|
||||
},
|
||||
if (oldestLockedBlock === null) {
|
||||
callback(null, oldestLockedBlock)
|
||||
} else {
|
||||
global.coinFuncs.getBlockHeaderByHash(oldestLockedBlock.hash, (err, result) => {
|
||||
oldestLockedBlock.height = result.height;
|
||||
console.log(Got the oldest block);
|
||||
callback(null, oldestLockedBlock);
|
||||
});
|
||||
}
|
||||
},
|
||||
function(oldestLockedBlock, callback){
|
||||
global.coinFuncs.getLastBlockHeader(function(err, body){
|
||||
if (oldestLockedBlock === null){
|
||||
|
|
@ -691,4 +695,4 @@ function Database(){
|
|||
}, 900000); // Set DB env reload for every 15 minutes.
|
||||
}
|
||||
|
||||
module.exports = Database;
|
||||
module.exports = Database;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue