Merge pull request #272 from maraoz/bug/bitcoind-crash

Bug/bitcoind crash
This commit is contained in:
Manuel Aráoz 2014-02-12 17:29:00 -02:00
commit b141e20ec9
2 changed files with 23 additions and 26 deletions

View File

@ -41,8 +41,7 @@ exports.blockindex = function(req, res, next, height) {
if (err) {
console.log(err);
res.status(400).send('Bad Request'); // TODO
}
else {
} else {
res.jsonp(hashStr);
}
});
@ -105,8 +104,7 @@ exports.list = function(req, res) {
bdb.getBlocksByDate(gte, lte, function(err, blocks) {
if (err) {
res.status(500).send(err);
}
else {
} else {
var blockshashList = [];
var limit = parseInt(req.query.limit || blocks.length);
if (blocks.length < limit) {
@ -118,6 +116,7 @@ exports.list = function(req, res) {
async.mapSeries(blockshashList,
function(hash, cb) {
getBlock(hash, function(err, info) {
if (err) return cb(err);
return cb(err, {
height: info.height,
size: info.size,

View File

@ -23,7 +23,6 @@ angular.module('insight.system').controller('IndexController',
$scope.flashMessage = $rootScope.flashMessage || null;
socket.on('tx', function(tx) {
console.log('Transaction received! ' + tx.txid);
$scope.txs.unshift(tx);
if (parseInt($scope.txs.length, 10) >= parseInt(TRANSACTION_DISPLAYED, 10)) {
$scope.txs = $scope.txs.splice(0, TRANSACTION_DISPLAYED);
@ -32,7 +31,6 @@ angular.module('insight.system').controller('IndexController',
socket.on('block', function(block) {
var blockHash = block.toString();
console.log('Block received! ' + JSON.stringify(blockHash));
_getBlocks();
});