remove seenTX.

This commit is contained in:
Christopher Jeffrey 2016-05-11 19:26:34 -07:00
parent 299a49e76b
commit 67dc96ff5d
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -1196,38 +1196,6 @@ Mempool.prototype.removeOrphan = function removeOrphan(tx, callback) {
});
};
/**
* Test a transaction hash to see if it has been seen as
* an orphan, in the mempool, or in the blockchain. This
* is the closest thing to a function
* named "DoesThisTransactionExist()".
* @param {TX} tx
* @param {Function} callback - Returns [Error, Boolean].
*/
Mempool.prototype.seenTX = function seenTX(tx, callback) {
var self = this;
var hash = tx.hash('hex');
return this.hasOrphan(hash, function(err, result) {
if (err)
return callback(err);
if (result)
return callback(null, true);
return self.hasTX(hash, function(err, result) {
if (err)
return callback(err);
if (result)
return callback(null, true);
return self.chain.db.hasTX(hash, callback);
});
});
};
/**
* Fill transaction with all unspent _and spent_
* coins. Similar to {@link Mempool#fillHistory}