diff --git a/lib/TransactionDb.js b/lib/TransactionDb.js index 2a407b71..00c9faeb 100644 --- a/lib/TransactionDb.js +++ b/lib/TransactionDb.js @@ -137,7 +137,7 @@ function spec(b) { }) .on('end', function() { - var k = SPENT_PREFIX + txid; + var k = SPENT_PREFIX + txid + '-'; db.createReadStream({ start: k, end: k + '~' @@ -166,7 +166,7 @@ function spec(b) { if (!info) return cb(); - var k = SPENT_PREFIX + info.txid; + var k = SPENT_PREFIX + info.txid + '-'; db.createReadStream({ start: k, end: k + '~' @@ -311,7 +311,7 @@ isspent */ // spent? - var k = SPENT_PREFIX + txid + '-' + n; + var k = SPENT_PREFIX + txid + '-' + n + '-'; db.createReadStream({ start: k, end: k + '~' @@ -365,7 +365,7 @@ isspent TransactionDb.prototype.fromAddr = function(addr, cb) { var self = this; - var k = ADDR_PREFIX + addr; + var k = ADDR_PREFIX + addr + '-'; var ret = []; db.createReadStream({ @@ -388,7 +388,7 @@ isspent .on('end', function() { async.eachLimit(ret, CONCURRENCY, function(o, e_c) { - var k = SPENT_PREFIX + o.txid + '-' + o.index; + var k = SPENT_PREFIX + o.txid + '-' + o.index + '-'; db.createReadStream({ start: k, end: k + '~' @@ -415,14 +415,13 @@ isspent }; - TransactionDb.prototype.removeFromTxId = function(txid, cb) { async.series([ function(c) { db.createReadStream({ - start: OUTS_PREFIX + txid, + start: OUTS_PREFIX + txid + '-', end: OUTS_PREFIX + txid + '~', }).pipe( db.createWriteStream({ @@ -432,7 +431,7 @@ isspent }, function(c) { db.createReadStream({ - start: SPENT_PREFIX + txid, + start: SPENT_PREFIX + txid + '-', end: SPENT_PREFIX + txid + '~' }) .pipe( @@ -578,7 +577,7 @@ isspent addrs.push(addr); } - // existed? + // existed? var k = OUTS_PREFIX + tx.txid + '-' + o.n; db.get(k, function(err) { if (err && err.notFound) { diff --git a/public/src/js/controllers/transactions.js b/public/src/js/controllers/transactions.js index 72f15d48..e22897cb 100644 --- a/public/src/js/controllers/transactions.js +++ b/public/src/js/controllers/transactions.js @@ -59,16 +59,15 @@ function($scope, $rootScope, $routeParams, $location, Global, Transaction, Trans tmp[addr].unconfirmedInput += items[i].unconfirmedInput; tmp[addr].dbError = tmp[addr].dbError || items[i].dbError; tmp[addr].valueSat += items[i].value * COIN; - tmp[addr].value = tmp[addr].valueSat / COIN; tmp[addr].items.push(items[i]); tmp[addr].notAddr = notAddr; tmp[addr].count++; } angular.forEach(tmp, function(v) { + v.value = parseInt(v.valueSat) / COIN; ret.push(v); }); - return ret; }; diff --git a/public/views/transaction/tx.html b/public/views/transaction/tx.html index 65a465d0..f38005f9 100644 --- a/public/views/transaction/tx.html +++ b/public/views/transaction/tx.html @@ -26,7 +26,8 @@