mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
Fix fractional transaction fee
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user