mempool: rename hasTX to hasEntry.
This commit is contained in:
parent
210ce4c767
commit
47c1955e2c
@ -277,7 +277,7 @@ Mempool.prototype._removeBlock = co(function* removeBlock(block, txs) {
|
|||||||
tx = txs[i];
|
tx = txs[i];
|
||||||
hash = tx.hash('hex');
|
hash = tx.hash('hex');
|
||||||
|
|
||||||
if (this.hasTX(hash))
|
if (this.hasEntry(hash))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -410,7 +410,7 @@ Mempool.prototype.limitSize = function limitSize(added) {
|
|||||||
entry = queue.shift();
|
entry = queue.shift();
|
||||||
hash = entry.hash('hex');
|
hash = entry.hash('hex');
|
||||||
|
|
||||||
if (!this.hasTX(hash))
|
if (!this.hasEntry(hash))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
this.evictEntry(entry);
|
this.evictEntry(entry);
|
||||||
@ -646,7 +646,7 @@ Mempool.prototype.getMeta = function getMeta(hash) {
|
|||||||
* @returns {Boolean}
|
* @returns {Boolean}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Mempool.prototype.hasTX = function hasTX(hash) {
|
Mempool.prototype.hasEntry = function hasEntry(hash) {
|
||||||
return this.map[hash] != null;
|
return this.map[hash] != null;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -664,7 +664,7 @@ Mempool.prototype.has = function has(hash) {
|
|||||||
if (this.hasOrphan(hash))
|
if (this.hasOrphan(hash))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return this.hasTX(hash);
|
return this.hasEntry(hash);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -682,7 +682,7 @@ Mempool.prototype.exists = function exists(hash) {
|
|||||||
if (this.hasOrphan(hash))
|
if (this.hasOrphan(hash))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return this.hasTX(hash);
|
return this.hasEntry(hash);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1381,7 +1381,7 @@ Mempool.prototype.getDepends = function getDepends(tx) {
|
|||||||
|
|
||||||
for (i = 0; i < prevout.length; i++) {
|
for (i = 0; i < prevout.length; i++) {
|
||||||
hash = prevout[i];
|
hash = prevout[i];
|
||||||
if (this.hasTX(hash))
|
if (this.hasEntry(hash))
|
||||||
depends.push(hash);
|
depends.push(hash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -412,7 +412,7 @@ Miner.prototype.build = function build(attempt) {
|
|||||||
input = tx.inputs[j];
|
input = tx.inputs[j];
|
||||||
prev = input.prevout.hash;
|
prev = input.prevout.hash;
|
||||||
|
|
||||||
if (!this.mempool.hasTX(prev))
|
if (!this.mempool.hasEntry(prev))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
item.depCount += 1;
|
item.depCount += 1;
|
||||||
|
|||||||
@ -516,12 +516,12 @@ FullNode.prototype.getTX = co(function* getTX(hash) {
|
|||||||
* @returns {Promise} - Returns Boolean.
|
* @returns {Promise} - Returns Boolean.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
FullNode.prototype.hasTX = function hasTX(hash) {
|
FullNode.prototype.hasTX = co(function* hasTX(hash) {
|
||||||
if (this.mempool.hasTX(hash))
|
if (this.mempool.hasEntry(hash))
|
||||||
return Promise.resolve(true);
|
return true;
|
||||||
|
|
||||||
return this.chain.db.hasTX(hash);
|
return yield this.chain.db.hasTX(hash);
|
||||||
};
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Expose
|
* Expose
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user