mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 02:55:50 +00:00
JS: Prevent Amount#negate from creating amounts that are negative zero.
This commit is contained in:
@@ -276,6 +276,9 @@ Amount.prototype.copyTo = function (d, negate) {
|
||||
this._currency.copyTo(d._currency);
|
||||
this._issuer.copyTo(d._issuer);
|
||||
|
||||
// Prevent negative zero
|
||||
if (d.is_zero()) d._is_negative = false;
|
||||
|
||||
return d;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user