Fix fractional transaction fee

This commit is contained in:
wltsmrz
2014-06-12 03:06:23 -07:00
parent 1cccf01bf2
commit 1186b4a314
2 changed files with 2 additions and 2 deletions

View File

@@ -286,7 +286,7 @@ Transaction.prototype._computeFee = function() {
var midInd = Math.floor(fees.length / 2);
var median = fees.length % 2 === 0
? (fees[midInd] + fees[midInd - 1]) / 2
? Math.floor(0.5 + (fees[midInd] + fees[midInd - 1]) / 2)
: fees[midInd];
return String(median);