From e38ee0789e44462f762eb7c507efd29f807d3c6d Mon Sep 17 00:00:00 2001 From: Matias Alejo Garcia Date: Wed, 17 Feb 2016 19:12:16 -0300 Subject: [PATCH] no double spend info --- lib/TransactionDb.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/TransactionDb.js b/lib/TransactionDb.js index aeec0d2..0725e71 100644 --- a/lib/TransactionDb.js +++ b/lib/TransactionDb.js @@ -180,7 +180,7 @@ TransactionDb.prototype._fillSpent = function(info, cb) { }; -TransactionDb.prototype._fillOutpoints = function(txInfo, cb) { +TransactionDb.prototype._fillOutpoints = function(txInfo, cb, opts) { var self = this; if (!txInfo || txInfo.isCoinBase) return cb(); @@ -224,7 +224,7 @@ TransactionDb.prototype._fillOutpoints = function(txInfo, cb) { i.doubleSpentTxID = null; } return c_in(); - }); + }, opts); }, function() { if (!incompleteInputs) { @@ -246,13 +246,14 @@ TransactionDb.prototype._getInfo = function(txid, next, opts) { self._fillOutpoints(txInfo, function() { + if (opts.noExtraInfo) return next(null,txInfo); self._fillSpent(txInfo, function() { return next(null, txInfo); }); - }); + }, opts); }); }; @@ -280,7 +281,7 @@ TransactionDb.prototype.fromIdWithInfo = function(txid, cb, opts) { }; // Gets address info from an outpoint -TransactionDb.prototype.fromTxIdN = function(txid, n, cb) { +TransactionDb.prototype.fromTxIdN = function(txid, n, cb, opts) { var self = this; var k = OUTS_PREFIX + txid + '-' + n; @@ -300,6 +301,9 @@ TransactionDb.prototype.fromTxIdN = function(txid, n, cb) { }; } + if (opts.noExtraInfo) + return cb(null, ret); + // spent? var k = SPENT_PREFIX + txid + '-' + n + '-'; db.createReadStream({