block without info on list of tx (eg. genesis block). url: block-index not founded. Fixed
This commit is contained in:
parent
91c1bec493
commit
0973047d80
@ -71,10 +71,13 @@ exports.list = function(req, res, next) {
|
|||||||
|
|
||||||
if (bId) {
|
if (bId) {
|
||||||
Block.fromHashWithInfo(bId, function(err, block) {
|
Block.fromHashWithInfo(bId, function(err, block) {
|
||||||
if (err && !block) {
|
if (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
res.status(404).send('Not found');
|
return res.status(500).send('Internal Server Error');
|
||||||
return next();
|
}
|
||||||
|
|
||||||
|
if (! block) {
|
||||||
|
return res.status(404).send('Not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
txLength = block.info.tx.length;
|
txLength = block.info.tx.length;
|
||||||
|
|||||||
@ -4,14 +4,15 @@ module.exports = function(app, historicSync) {
|
|||||||
|
|
||||||
//Home route
|
//Home route
|
||||||
var index = require('../app/controllers/index');
|
var index = require('../app/controllers/index');
|
||||||
|
|
||||||
app.get('/', index.render);
|
app.get('/', index.render);
|
||||||
app.get('/blocks', index.render);
|
app.get('/blocks', index.render);
|
||||||
app.get('/blocks-date/*', index.render);
|
app.get('/blocks-date/*', index.render);
|
||||||
|
app.get('/block-index/*', index.render);
|
||||||
app.get('/block/*', index.render);
|
app.get('/block/*', index.render);
|
||||||
app.get('/tx/*', index.render);
|
app.get('/tx/*', index.render);
|
||||||
app.get('/address/*', index.render);
|
app.get('/address/*', index.render);
|
||||||
|
|
||||||
app.get('/api/version', index.version);
|
app.get('/api/version', index.version);
|
||||||
|
|
||||||
//Block routes
|
//Block routes
|
||||||
@ -41,5 +42,5 @@ module.exports = function(app, historicSync) {
|
|||||||
app.get('/api/status', st.show);
|
app.get('/api/status', st.show);
|
||||||
|
|
||||||
app.get('/api/sync', st.sync);
|
app.get('/api/sync', st.sync);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -9,7 +9,7 @@ angular.module('insight').config(['$routeProvider',
|
|||||||
}).
|
}).
|
||||||
when('/block-index/:blockHeight', {
|
when('/block-index/:blockHeight', {
|
||||||
controller: 'BlocksController',
|
controller: 'BlocksController',
|
||||||
template: 'Redirecting...'
|
templateUrl: '/views/redirect.html'
|
||||||
}).
|
}).
|
||||||
when('/tx/:txId', {
|
when('/tx/:txId', {
|
||||||
templateUrl: '/views/transaction.html'
|
templateUrl: '/views/transaction.html'
|
||||||
|
|||||||
1
public/views/redirect.html
Normal file
1
public/views/redirect.html
Normal file
@ -0,0 +1 @@
|
|||||||
|
<div class="text-center">Redirecting...</div>
|
||||||
Loading…
Reference in New Issue
Block a user