mirror of
https://github.com/GOSTSec/gostexplr
synced 2025-09-10 13:11:47 +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
|
// looking for address
|
||||||
const address = await models.Address.findOne({
|
const address = await models.Address.findOne({
|
||||||
where: {
|
where: {
|
||||||
@ -36,7 +37,7 @@ router.post('/', async function(req, res, next) {
|
|||||||
res.redirect(`/address/${address.address}/`);
|
res.redirect(`/address/${address.address}/`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
} else if(search.length === 64) {
|
||||||
// looking for transaction
|
// looking for transaction
|
||||||
const transaction = await models.Transaction.findOne({
|
const transaction = await models.Transaction.findOne({
|
||||||
where: {
|
where: {
|
||||||
@ -58,6 +59,8 @@ router.post('/', async function(req, res, next) {
|
|||||||
res.redirect(`/block/${block.hash}/`);
|
res.redirect(`/block/${block.hash}/`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
res.status(404).render('404');
|
res.status(404).render('404');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user