mirror of
https://github.com/jwinterm/nodejs-pool.git
synced 2026-10-24 06:28:35 +02:00
+11
-7
@@ -581,12 +581,16 @@ function Database(){
|
|||||||
let oldestLockedBlock = this.getOldestLockedBlock();
|
let oldestLockedBlock = this.getOldestLockedBlock();
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
function(callback){
|
function(callback){
|
||||||
global.coinFuncs.getBlockHeaderByHash(oldestLockedBlock.hash, (err, result) => {
|
if (oldestLockedBlock === null) {
|
||||||
oldestLockedBlock.height = result.height;
|
callback(null, oldestLockedBlock)
|
||||||
console.log(`Got the oldest block`);
|
} else {
|
||||||
callback(null, oldestLockedBlock);
|
global.coinFuncs.getBlockHeaderByHash(oldestLockedBlock.hash, (err, result) => {
|
||||||
});
|
oldestLockedBlock.height = result.height;
|
||||||
},
|
console.log(Got the oldest block);
|
||||||
|
callback(null, oldestLockedBlock);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
function(oldestLockedBlock, callback){
|
function(oldestLockedBlock, callback){
|
||||||
global.coinFuncs.getLastBlockHeader(function(err, body){
|
global.coinFuncs.getLastBlockHeader(function(err, body){
|
||||||
if (oldestLockedBlock === null){
|
if (oldestLockedBlock === null){
|
||||||
@@ -691,4 +695,4 @@ function Database(){
|
|||||||
}, 900000); // Set DB env reload for every 15 minutes.
|
}, 900000); // Set DB env reload for every 15 minutes.
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Database;
|
module.exports = Database;
|
||||||
|
|||||||
Reference in New Issue
Block a user