|
|
@@ -190,6 +190,30 @@ router.post("/search", function(req, res) { |
|
|
|
|
|
|
|
var query = req.body.query.toLowerCase(); |
|
|
|
|
|
|
|
if (query === null || query === "null" || query.length < 1) { |
|
|
|
res.redirect("/"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
query = query.replace(/,/g, ""); |
|
|
|
|
|
|
|
if (query.stringLength < 9) { |
|
|
|
if (typeof query == "number") { |
|
|
|
res.redirect("/block-height/" + query); |
|
|
|
console.log('This is a block'); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (query.stringLength < 36) { |
|
|
|
if (typeof query != "number") { |
|
|
|
res.redirect("/address/" + query); |
|
|
|
console.log('This is not number'); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
rpcApi.getRawTransaction(query).then(function(tx) { |
|
|
|
if (tx) { |
|
|
|
res.redirect("/tx/" + query); |
|
|
|