diff --git a/app/models/Transaction.js b/app/models/Transaction.js index 5e418adf..e7f08826 100644 --- a/app/models/Transaction.js +++ b/app/models/Transaction.js @@ -279,7 +279,7 @@ TransactionSchema.statics.queryInfo = function(txid, cb) { else { tx.ins.forEach(function(i) { if (i.value) { - info.vin[c].value = util.formatValue(i.value); + info.vin[c].value = parseFloat(util.formatValue(i.value)); var n = util.valueToBigInt(i.value).toNumber(); info.vin[c].valueSat = n; valueIn = valueIn.add( n ); diff --git a/public/css/common.css b/public/css/common.css index 5747588c..525bd9aa 100644 --- a/public/css/common.css +++ b/public/css/common.css @@ -314,4 +314,13 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { background-color: #1a1a1a; } +.expanded-tx { + border-bottom: 1px dashed #444; +} + + +.expanded-tx small { + font-size: 80%; +} + diff --git a/public/js/controllers/transactions.js b/public/js/controllers/transactions.js index c82b6599..7488ed3a 100644 --- a/public/js/controllers/transactions.js +++ b/public/js/controllers/transactions.js @@ -29,11 +29,13 @@ angular.module('insight.transactions').controller('transactionsController', // non standard output if (items[i].scriptPubKey && items[i].scriptPubKey.addresses.length > 1) { + item[i].addr = items[i].scriptPubKey.addresses.join(','); ret.push(items[i]); continue; } - var addr = items[i].addr || items[i].scriptPubKey.addresses[0]; + var addr = items[i].addr || + (items[i].scriptPubKey && items[i].scriptPubKey.addresses[0] ); if (!tmp[addr]) { tmp[addr] = {}; tmp[addr].valueSat = 0; @@ -57,7 +59,6 @@ angular.module('insight.transactions').controller('transactionsController', $scope.processTX = function(tx) { tx.vinSimple = $scope.aggregateItems(tx.vin); tx.voutSimple = $scope.aggregateItems(tx.vout); -console.log('[transactions.js.33:insSimple:]',tx); //TODO }; $scope.findTx = function(txid) { @@ -65,7 +66,7 @@ console.log('[transactions.js.33:insSimple:]',tx); //TODO txId: txid }, function(tx) { $scope.tx = tx; -$scope.processTX(tx); + $scope.processTX(tx); $scope.txs.push(tx); }, function(e) { if (e.status === 400) { @@ -85,6 +86,9 @@ $scope.processTX(tx); TransactionsByBlock.query({ block: bId }, function(txs) { + angular.forEach(txs, function(tx) { + $scope.processTX(tx); + }); $scope.txs = txs; }); }; @@ -93,6 +97,9 @@ $scope.processTX(tx); TransactionsByAddress.query({ address: aId }, function(txs) { + angular.forEach(txs, function(tx) { + $scope.processTX(tx); + }); $scope.txs = txs; }); }; diff --git a/public/views/transaction.html b/public/views/transaction.html index 8e4ee015..4e325be5 100644 --- a/public/views/transaction.html +++ b/public/views/transaction.html @@ -48,19 +48,6 @@ -
{{vin.reward}} BTC
-{{vin.value}} BTC
- - +{{vin.value}} BTC
+ + +{{vout.value}} BTC
{{vout.value}} BTC
+