diff --git a/routes/index.js b/routes/index.js index f7abd87..1e35788 100644 --- a/routes/index.js +++ b/routes/index.js @@ -29,7 +29,18 @@ function route_get_block(res, blockhash) { }); } } else { - route_get_index(res, 'Block not found: ' + blockhash); + if (!isNaN(blockhash)) { + var height = blockhash; + lib.get_blockhash(height, function(hash) { + if (hash != 'There was an error. Check your console.') { + res.redirect('/block/' + hash); + } else { + route_get_index(res, 'Block not found: ' + blockhash); + } + }); + } else { + route_get_index(res, 'Block not found: ' + blockhash); + } } }); }