mirror of
https://github.com/GOSTSec/gostexplr
synced 2025-03-10 04:21:15 +00:00
Confirmations calculation
This commit is contained in:
parent
92f5d7a1bc
commit
58b565f65e
@ -9,7 +9,7 @@ body {
|
||||
}
|
||||
|
||||
table td {
|
||||
padding-right: 1em;
|
||||
padding-right: .5em;
|
||||
}
|
||||
|
||||
a {
|
||||
|
@ -12,11 +12,17 @@ router.get('/:hash', async function(req, res, next) {
|
||||
include: {
|
||||
model: models.Transaction,
|
||||
},
|
||||
})
|
||||
});
|
||||
if (block === null) {
|
||||
res.status(404).render('404');
|
||||
return;
|
||||
}
|
||||
const lastBlock = await models.Block.findOne({
|
||||
attributes: [
|
||||
[models.sequelize.fn('MAX', models.sequelize.col('height')), 'maxheight']
|
||||
],
|
||||
});
|
||||
block.dataValues.confirmations = lastBlock.dataValues.maxheight - block.height + 1;
|
||||
block.dataValues.time = block.time.toUTCString();
|
||||
res.render('block', {
|
||||
block,
|
||||
|
Loading…
x
Reference in New Issue
Block a user