priority calculation.

This commit is contained in:
Christopher Jeffrey 2016-05-16 04:55:39 -07:00
parent 8f3fae329d
commit 533e644284
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
2 changed files with 3 additions and 3 deletions

View File

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

View File

@ -1450,7 +1450,7 @@ TX.prototype.getPriority = function getPriority(height, size) {
return {
value: value,
priority: sum / size
priority: Math.floor(sum / size)
};
};