diff --git a/lib/TransactionDb.js b/lib/TransactionDb.js index 5eb1a5bc..02fa1fdb 100644 --- a/lib/TransactionDb.js +++ b/lib/TransactionDb.js @@ -134,6 +134,27 @@ function spec(b) { }); }; + + TransactionDb.prototype._fillSpend = function(info, cb) { + var self = this; + + if (!info) return cb(); + + var k = SPEND_PREFIX + info.txid; + db.createReadStream({start: k, end: k + '~'}) + .on('data', function (data) { + var k = data.key.split('-'); + self._addSpendInfo(info.vout[k[3]], k[4], k[5]); + }) + .on('error', function (err) { + return cb(err); + }) + .on('end', function (err) { + return cb(err); + }); + }; + + TransactionDb.prototype._fillOutpoints = function(info, cb) { var self = this; @@ -205,7 +226,9 @@ function spec(b) { if (err) return next(err); self._fillOutpoints(info, function() { - return next(null, info); + self._fillSpend(info, function() { + return next(null, info); + }); }); }); }; @@ -226,8 +249,6 @@ function spec(b) { var k = OUTS_PREFIX + txid + '-' + n; db.get(k, function (err,val) { - -console.log('[TransactionDb.js.230]'); //TODO if (!val || (err && err.notFound) ) { return cb(null, { unconfirmedInput: 1} ); } diff --git a/public/src/js/controllers/transactions.js b/public/src/js/controllers/transactions.js index e754b6fc..4f2842da 100644 --- a/public/src/js/controllers/transactions.js +++ b/public/src/js/controllers/transactions.js @@ -52,6 +52,7 @@ function($scope, $rootScope, $routeParams, $location, Global, Transaction, Trans tmp[addr].addr = addr; tmp[addr].items = []; } + tmp[addr].isSpend = items[i].spendTxId; tmp[addr].doubleSpendTxID = tmp[addr].doubleSpendTxID || items[i].doubleSpendTxID; tmp[addr].doubleSpendIndex = tmp[addr].doubleSpendIndex || items[i].doubleSpendIndex; diff --git a/public/views/index.html b/public/views/index.html index 4b8459cb..18ae8165 100644 --- a/public/views/index.html +++ b/public/views/index.html @@ -64,7 +64,7 @@ that need more advanced blockchain queries than provided by bitcoind RPC. Check out the source code. -

Power by +

Powered by

diff --git a/public/views/transaction/tx.html b/public/views/transaction/tx.html index 4c588a60..2c36fa3b 100644 --- a/public/views/transaction/tx.html +++ b/public/views/transaction/tx.html @@ -73,7 +73,15 @@

-
{{$root.currency.getConvertion(vout.value)}}
+
+ + + {{$root.currency.getConvertion(vout.value)}} + (S) + (U) + +
+
{{vout.addr}} {{vout.addr}} @@ -85,7 +93,14 @@
-
{{$root.currency.getConvertion(vout.value)}}
+
{{$root.currency.getConvertion(vout.value)}} + (U) +    + + + + +