diff --git a/app.js b/app.js index 678afc3..31efd78 100644 --- a/app.js +++ b/app.js @@ -188,7 +188,7 @@ app.use('/ext/gettx/:txid', function(req, res) { db.get_tx(txid, function(tx) { if (tx) { lib.get_blockcount(function(blockcount) { - res.send({ active: 'tx', tx: tx, confirmations: settings.shared_pages.confirmations, blockcount: (blockcount ? blockcount : 0)}); + res.send({ active: 'tx', tx: tx, confirmations: (blockcount - tx.blockindex + 1), blockcount: (blockcount ? blockcount : 0)}); }); } else { lib.get_rawtransaction(txid, function(rtx) { @@ -207,7 +207,7 @@ app.use('/ext/gettx/:txid', function(req, res) { blockindex: -1 }; - res.send({ active: 'tx', tx: utx, confirmations: settings.shared_pages.confirmations, blockcount:-1}); + res.send({ active: 'tx', tx: utx, confirmations: rtx.confirmations, blockcount:-1}); } else { var utx = { txid: rtx.txid, @@ -220,7 +220,7 @@ app.use('/ext/gettx/:txid', function(req, res) { }; lib.get_blockcount(function(blockcount) { - res.send({ active: 'tx', tx: utx, confirmations: settings.shared_pages.confirmations, blockcount: (blockcount ? blockcount : 0)}); + res.send({ active: 'tx', tx: utx, confirmations: rtx.confirmations, blockcount: (blockcount ? blockcount : 0)}); }); } });