From 4e88c6fe5d9aab9c24e13a5dfc019ed51a189878 Mon Sep 17 00:00:00 2001 From: Mario Colque Date: Wed, 29 Jan 2014 10:26:03 -0300 Subject: [PATCH] limit live transactions in the homepage --- public/js/controllers/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/js/controllers/index.js b/public/js/controllers/index.js index 3e76640..c2fc5fc 100755 --- a/public/js/controllers/index.js +++ b/public/js/controllers/index.js @@ -31,12 +31,12 @@ angular.module('insight.system').controller('IndexController', socket.on('tx', function(tx) { var txStr = tx.txid.toString(); + _getTransaction(txStr); + console.log('Transaction received! ' + JSON.stringify(tx)); - if (parseInt($scope.txs.length, 10) > parseInt(TRANSACTION_DISPLAYED, 10) - 1) { + if (parseInt($scope.txs.length, 10) > parseInt(TRANSACTION_DISPLAYED, 10)) { $scope.txs = $scope.txs.slice(Math.max($scope.txs.length - TRANSACTION_DISPLAYED, 1)); } - - _getTransaction(txStr); }); socket.on('block', function(block) {