|
|
@ -3,10 +3,10 @@ var express = require('express'); |
|
|
|
var router = express.Router(); |
|
|
|
var router = express.Router(); |
|
|
|
|
|
|
|
|
|
|
|
/* GET home page. */ |
|
|
|
/* GET home page. */ |
|
|
|
router.get('/:txid', function(req, res, next) { |
|
|
|
router.get('/:txid', async function(req, res, next) { |
|
|
|
const txid = encodeURI(req.params.txid); |
|
|
|
const txid = encodeURI(req.params.txid); |
|
|
|
|
|
|
|
|
|
|
|
models.Transaction.findOne({ |
|
|
|
const transaction = await models.Transaction.findOne({ |
|
|
|
where: { |
|
|
|
where: { |
|
|
|
txid, |
|
|
|
txid, |
|
|
|
}, |
|
|
|
}, |
|
|
@ -22,8 +22,7 @@ router.get('/:txid', function(req, res, next) { |
|
|
|
model: models.Transaction, |
|
|
|
model: models.Transaction, |
|
|
|
as: 'txtx', |
|
|
|
as: 'txtx', |
|
|
|
}], |
|
|
|
}], |
|
|
|
}) |
|
|
|
}); |
|
|
|
.then((transaction) => { |
|
|
|
|
|
|
|
if (transaction === null) { |
|
|
|
if (transaction === null) { |
|
|
|
res.status(404).render('404'); |
|
|
|
res.status(404).render('404'); |
|
|
|
return; |
|
|
|
return; |
|
|
@ -41,8 +40,6 @@ router.get('/:txid', function(req, res, next) { |
|
|
|
transaction, |
|
|
|
transaction, |
|
|
|
vouts, |
|
|
|
vouts, |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
module.exports = router; |
|
|
|
module.exports = router; |
|
|
|