diff --git a/lib/bcoin/mempool.js b/lib/bcoin/mempool.js index b3c78ea0..b10c0683 100644 --- a/lib/bcoin/mempool.js +++ b/lib/bcoin/mempool.js @@ -865,7 +865,7 @@ Mempool.prototype.removeUnchecked = function removeUnchecked(entry, limit, callb */ Mempool.prototype.getMinRate = function getMinRate() { - var now, halflife, exp; + var now, halflife, size; if (!this.blockSinceBump || this.minFeeRate === 0) return this.minFeeRate; @@ -874,10 +874,11 @@ Mempool.prototype.getMinRate = function getMinRate() { if (now > this.lastFeeUpdate + 10) { halflife = constants.mempool.FEE_HALFLIFE; + size = this.getSize(); - if (this.size < this.maxSize / 4) + if (size < this.maxSize / 4) halflife >>>= 2; - else if (this.size < this.maxSize / 2) + else if (size < this.maxSize / 2) halflife >>>= 1; this.minFeeRate /= Math.pow(2.0, (now - this.lastFeeUpdate) / halflife | 0);