remove seenTX.
This commit is contained in:
parent
299a49e76b
commit
67dc96ff5d
@ -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}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user