mempool: fix mempool.has().
This commit is contained in:
parent
099fe186f0
commit
5a6099e992
@ -517,11 +517,23 @@ Mempool.prototype.has = function has(hash) {
|
|||||||
if (this.locker.hasPending(hash))
|
if (this.locker.hasPending(hash))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (this.hasOrphan(hash))
|
if (hash === this.currentTX)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
//if (hash === this.currentTX)
|
return this.exists(hash);
|
||||||
//return true;
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the mempool to see if it
|
||||||
|
* contains a transaction or an orphan.
|
||||||
|
* @private
|
||||||
|
* @param {Hash} hash
|
||||||
|
* @returns {Boolean}
|
||||||
|
*/
|
||||||
|
|
||||||
|
Mempool.prototype.exists = function exists(hash) {
|
||||||
|
if (this.hasOrphan(hash))
|
||||||
|
return true;
|
||||||
|
|
||||||
return this.hasTX(hash);
|
return this.hasTX(hash);
|
||||||
};
|
};
|
||||||
@ -639,7 +651,7 @@ Mempool.prototype._addTX = co(function* _addTX(tx) {
|
|||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.has(hash)) {
|
if (this.exists(hash)) {
|
||||||
throw new VerifyError(tx,
|
throw new VerifyError(tx,
|
||||||
'alreadyknown',
|
'alreadyknown',
|
||||||
'txn-already-in-mempool',
|
'txn-already-in-mempool',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user