From 382fc57add5554a41e30c63569196aa57d3441c4 Mon Sep 17 00:00:00 2001 From: Alexander Blair Date: Wed, 1 Nov 2017 10:25:06 -0700 Subject: [PATCH] Update with small fixes for the comms system. --- lib/local_comms.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/local_comms.js b/lib/local_comms.js index ef379c5..f8afb96 100644 --- a/lib/local_comms.js +++ b/lib/local_comms.js @@ -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){ /*