From db8b6e2728150672f7e7e02272998c3215e652b7 Mon Sep 17 00:00:00 2001 From: Gustavo Cortez Date: Sun, 9 Feb 2014 21:11:20 -0300 Subject: [PATCH] when arrive tx, push on list. fixed streamed blocks on homepage. --- app/controllers/blocks.js | 3 +++ insight.js | 2 +- lib/TransactionRpc.js | 4 ++-- public/js/controllers/header.js | 2 +- public/js/controllers/index.js | 24 +++++++++++++++--------- 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/app/controllers/blocks.js b/app/controllers/blocks.js index 4eae98e6..a2b6ca7b 100644 --- a/app/controllers/blocks.js +++ b/app/controllers/blocks.js @@ -109,6 +109,9 @@ exports.list = function(req, res) { else { var blockshashList = []; var limit = parseInt(req.query.limit || blocks.length); + if (blocks.length < limit) { + limit = blocks.length; + } for(var i=0;i= parseInt(TRANSACTION_DISPLAYED, 10)) { + $scope.txs = $scope.txs.splice(0, TRANSACTION_DISPLAYED); + } + }); }); socket.on('block', function(block) { - var blockHash = block.hash.hash.toString(); + var blockHash = block.hash.toString(); console.log('Block received! ' + JSON.stringify(blockHash)); _getBlocks(); }); @@ -48,7 +55,6 @@ angular.module('insight.system').controller('IndexController', $scope.index = function() { _getBlocks(); - _getTransactions(); }; $scope.txs = [];