halflife.

This commit is contained in:
Christopher Jeffrey 2016-05-13 05:53:51 -07:00
parent 361134029f
commit 5193e3533a
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -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);