mirror of
https://github.com/GOSTSec/gostexplr
synced 2025-09-10 05:02:30 +00:00
Detect by search string length what to search for
This commit is contained in:
parent
68d2778434
commit
33d9bd112c
@ -26,6 +26,7 @@ router.post('/', async function(req, res, next) {
|
||||
}
|
||||
}
|
||||
|
||||
if (search.length === 34) {
|
||||
// looking for address
|
||||
const address = await models.Address.findOne({
|
||||
where: {
|
||||
@ -36,7 +37,7 @@ router.post('/', async function(req, res, next) {
|
||||
res.redirect(`/address/${address.address}/`);
|
||||
return;
|
||||
}
|
||||
|
||||
} else if(search.length === 64) {
|
||||
// looking for transaction
|
||||
const transaction = await models.Transaction.findOne({
|
||||
where: {
|
||||
@ -58,6 +59,8 @@ router.post('/', async function(req, res, next) {
|
||||
res.redirect(`/block/${block.hash}/`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
res.status(404).render('404');
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user