Merge pull request #456 from matiu/opt/multi4

no double spend info
This commit is contained in:
Ivan Socolsky 2016-02-18 10:21:57 -03:00
commit 437b9e40ca

View File

@ -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({