|
|
|
@ -643,7 +643,7 @@ function Database(){
|
|
|
|
|
cursor.close();
|
|
|
|
|
txn.commit();
|
|
|
|
|
if (highestBlock !== null) {
|
|
|
|
|
debug("Got the oldest locked block in the system at height: " + highestBlock);
|
|
|
|
|
debug("Got the oldest locked block in the system at height: " + JSON.stringify(highestBlock));
|
|
|
|
|
} else {
|
|
|
|
|
debug("There are no unlocked blocks in the system. Woohoo!");
|
|
|
|
|
}
|
|
|
|
@ -682,6 +682,12 @@ function Database(){
|
|
|
|
|
let oldestLockedBlock = this.getOldestLockedBlock();
|
|
|
|
|
async.waterfall([
|
|
|
|
|
function(callback){
|
|
|
|
|
global.coinFuncs.getBlockHeaderByHash(oldestLockedBlock.hash, (err, result) => {
|
|
|
|
|
oldestLockedBlock.height = result.height;
|
|
|
|
|
callback(oldestLockedBlock);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
function(oldestLockedBlock, callback){
|
|
|
|
|
global.coinFuncs.getLastBlockHeader(function(err, body){
|
|
|
|
|
if (oldestLockedBlock === null){
|
|
|
|
|
/*
|
|
|
|
|