From 045f3b5541c14112f0505c35782135ae9a0f64c6 Mon Sep 17 00:00:00 2001 From: Derek May <32908855+riddlez666@users.noreply.github.com> Date: Sun, 25 Feb 2018 07:12:18 -0800 Subject: [PATCH] cherry picked index.js --- routes/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/routes/index.js b/routes/index.js index 25479672..9bddfbd9 100644 --- a/routes/index.js +++ b/routes/index.js @@ -19,7 +19,7 @@ router.get('/', function(req, res, next) { }, function(lastBlock, callback) { var blocks = []; - var blockCount = 10; + var blockCount = 5; if (lastBlock.number - blockCount < 0) { blockCount = lastBlock.number + 1; @@ -41,13 +41,15 @@ router.get('/', function(req, res, next) { var txs = []; blocks.forEach(function(block) { block.transactions.forEach(function(tx) { - if (txs.length === 10) { + if (txs.length === 5) { return; } txs.push(tx); }); }); - res.render('index', { blocks: blocks, txs: txs }); + var diff = blocks[0].difficulty; + //console.log(diff); + res.render('index', { blocks: blocks, txs: txs, diff: diff }); }); });