Update with small fixes for the comms system.

master
Alexander Blair 7 years ago
parent 81d6207d71
commit 382fc57add

@ -643,7 +643,7 @@ function Database(){
cursor.close(); cursor.close();
txn.commit(); txn.commit();
if (highestBlock !== null) { 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 { } else {
debug("There are no unlocked blocks in the system. Woohoo!"); debug("There are no unlocked blocks in the system. Woohoo!");
} }
@ -682,6 +682,12 @@ 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) => {
oldestLockedBlock.height = result.height;
callback(oldestLockedBlock);
});
},
function(oldestLockedBlock, callback){
global.coinFuncs.getLastBlockHeader(function(err, body){ global.coinFuncs.getLastBlockHeader(function(err, body){
if (oldestLockedBlock === null){ if (oldestLockedBlock === null){
/* /*

Loading…
Cancel
Save