1
0
mirror of https://github.com/GOSTSec/gostexplr synced 2025-03-10 04:21:15 +00:00

Confirmations calculation

This commit is contained in:
xcps 2018-02-04 23:00:35 +05:00
parent 92f5d7a1bc
commit 58b565f65e
2 changed files with 8 additions and 2 deletions

View File

@ -9,7 +9,7 @@ body {
}
table td {
padding-right: 1em;
padding-right: .5em;
}
a {

View File

@ -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,