Add functionality to /block page to use height as well as hash
This commit is contained in:
+12
-1
@@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user