diff --git a/lib/bcoin/mempool.js b/lib/bcoin/mempool.js index efa14849..a8fdaeae 100644 --- a/lib/bcoin/mempool.js +++ b/lib/bcoin/mempool.js @@ -1865,8 +1865,8 @@ MempoolEntry.fromRaw = function fromRaw(data) { MempoolEntry.prototype.getPriority = function getPriority(height) { var heightDelta = height - this.height; var modSize = this.tx.getModifiedSize(this.size); - var deltaPriority = heightDelta * this.chainValue / modSize; - var result = this.priority + deltaPriority; + var deltaPriority = (heightDelta * this.chainValue) / modSize; + var result = this.priority + Math.floor(deltaPriority); if (result < 0) result = 0; return result; diff --git a/lib/bcoin/tx.js b/lib/bcoin/tx.js index e0ec171c..55160cf6 100644 --- a/lib/bcoin/tx.js +++ b/lib/bcoin/tx.js @@ -1450,7 +1450,7 @@ TX.prototype.getPriority = function getPriority(height, size) { return { value: value, - priority: sum / size + priority: Math.floor(sum / size) }; };