Merge pull request #272 from maraoz/bug/bitcoind-crash
Bug/bitcoind crash
This commit is contained in:
commit
b141e20ec9
@ -41,8 +41,7 @@ exports.blockindex = function(req, res, next, height) {
|
|||||||
if (err) {
|
if (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
res.status(400).send('Bad Request'); // TODO
|
res.status(400).send('Bad Request'); // TODO
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
res.jsonp(hashStr);
|
res.jsonp(hashStr);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -105,8 +104,7 @@ exports.list = function(req, res) {
|
|||||||
bdb.getBlocksByDate(gte, lte, function(err, blocks) {
|
bdb.getBlocksByDate(gte, lte, function(err, blocks) {
|
||||||
if (err) {
|
if (err) {
|
||||||
res.status(500).send(err);
|
res.status(500).send(err);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
var blockshashList = [];
|
var blockshashList = [];
|
||||||
var limit = parseInt(req.query.limit || blocks.length);
|
var limit = parseInt(req.query.limit || blocks.length);
|
||||||
if (blocks.length < limit) {
|
if (blocks.length < limit) {
|
||||||
@ -118,6 +116,7 @@ exports.list = function(req, res) {
|
|||||||
async.mapSeries(blockshashList,
|
async.mapSeries(blockshashList,
|
||||||
function(hash, cb) {
|
function(hash, cb) {
|
||||||
getBlock(hash, function(err, info) {
|
getBlock(hash, function(err, info) {
|
||||||
|
if (err) return cb(err);
|
||||||
return cb(err, {
|
return cb(err, {
|
||||||
height: info.height,
|
height: info.height,
|
||||||
size: info.size,
|
size: info.size,
|
||||||
|
|||||||
@ -23,7 +23,6 @@ angular.module('insight.system').controller('IndexController',
|
|||||||
$scope.flashMessage = $rootScope.flashMessage || null;
|
$scope.flashMessage = $rootScope.flashMessage || null;
|
||||||
|
|
||||||
socket.on('tx', function(tx) {
|
socket.on('tx', function(tx) {
|
||||||
console.log('Transaction received! ' + tx.txid);
|
|
||||||
$scope.txs.unshift(tx);
|
$scope.txs.unshift(tx);
|
||||||
if (parseInt($scope.txs.length, 10) >= parseInt(TRANSACTION_DISPLAYED, 10)) {
|
if (parseInt($scope.txs.length, 10) >= parseInt(TRANSACTION_DISPLAYED, 10)) {
|
||||||
$scope.txs = $scope.txs.splice(0, TRANSACTION_DISPLAYED);
|
$scope.txs = $scope.txs.splice(0, TRANSACTION_DISPLAYED);
|
||||||
@ -32,7 +31,6 @@ angular.module('insight.system').controller('IndexController',
|
|||||||
|
|
||||||
socket.on('block', function(block) {
|
socket.on('block', function(block) {
|
||||||
var blockHash = block.toString();
|
var blockHash = block.toString();
|
||||||
console.log('Block received! ' + JSON.stringify(blockHash));
|
|
||||||
_getBlocks();
|
_getBlocks();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user