messiest yet, bump confs by 1

This commit is contained in:
tenthirtyone 2017-08-15 04:11:22 -04:00
parent 2b8eee6e03
commit 17acbdda6d

View File

@ -71,7 +71,7 @@ module.exports = function transactionAPI(router) {
locktime: body.locktime,
blockhash: body.block,
fees: body.fee / 1e8,
confirmations: height - body.height,
confirmations: height - body.height + 1,
valueOut: body.outputs.reduce((sum, output) => sum + output.value, 0) / 1e8,
vin: body.inputs.map(input => ({
addr: input.coin ? input.coin.address : '',
@ -120,7 +120,7 @@ module.exports = function transactionAPI(router) {
txs: body.txs.map(tx => ({
txid: tx.hash,
fees: tx.fee / 1e8,
confirmations: height - body.height,
confirmations: height - body.height + 1,
valueOut: tx.outputs.reduce((sum, output) => sum + output.value, 0) / 1e8,
vin: tx.inputs.map(input => ({
addr: input.coin ? input.coin.address : '',
@ -166,7 +166,7 @@ module.exports = function transactionAPI(router) {
txs: body.map(tx => ({
txid: tx.hash,
fees: tx.fee / 1e8,
confirmations: height - tx.height,
confirmations: height - tx.height + 1,
valueOut: tx.outputs.reduce((sum, output) => sum + output.value, 0) / 1e8,
vin: tx.inputs.map(input => ({
addr: input.coin ? input.coin.address : '',