mempool: rename hasTX to hasEntry.

This commit is contained in:
Christopher Jeffrey 2017-03-05 10:02:34 -08:00
parent 210ce4c767
commit 47c1955e2c
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
3 changed files with 12 additions and 12 deletions

View File

@ -277,7 +277,7 @@ Mempool.prototype._removeBlock = co(function* removeBlock(block, txs) {
tx = txs[i];
hash = tx.hash('hex');
if (this.hasTX(hash))
if (this.hasEntry(hash))
continue;
try {
@ -410,7 +410,7 @@ Mempool.prototype.limitSize = function limitSize(added) {
entry = queue.shift();
hash = entry.hash('hex');
if (!this.hasTX(hash))
if (!this.hasEntry(hash))
continue;
this.evictEntry(entry);
@ -646,7 +646,7 @@ Mempool.prototype.getMeta = function getMeta(hash) {
* @returns {Boolean}
*/
Mempool.prototype.hasTX = function hasTX(hash) {
Mempool.prototype.hasEntry = function hasEntry(hash) {
return this.map[hash] != null;
};
@ -664,7 +664,7 @@ Mempool.prototype.has = function has(hash) {
if (this.hasOrphan(hash))
return true;
return this.hasTX(hash);
return this.hasEntry(hash);
};
/**
@ -682,7 +682,7 @@ Mempool.prototype.exists = function exists(hash) {
if (this.hasOrphan(hash))
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++) {
hash = prevout[i];
if (this.hasTX(hash))
if (this.hasEntry(hash))
depends.push(hash);
}

View File

@ -412,7 +412,7 @@ Miner.prototype.build = function build(attempt) {
input = tx.inputs[j];
prev = input.prevout.hash;
if (!this.mempool.hasTX(prev))
if (!this.mempool.hasEntry(prev))
continue;
item.depCount += 1;

View File

@ -516,12 +516,12 @@ FullNode.prototype.getTX = co(function* getTX(hash) {
* @returns {Promise} - Returns Boolean.
*/
FullNode.prototype.hasTX = function hasTX(hash) {
if (this.mempool.hasTX(hash))
return Promise.resolve(true);
FullNode.prototype.hasTX = co(function* hasTX(hash) {
if (this.mempool.hasEntry(hash))
return true;
return this.chain.db.hasTX(hash);
};
return yield this.chain.db.hasTX(hash);
});
/*
* Expose