mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Fix logic error in Amount.add which caused results to always be positive.
This commit is contained in:
@@ -554,10 +554,9 @@ Amount.prototype.add = function (v) {
|
||||
result._offset = o1;
|
||||
result._value = v1.add(v2);
|
||||
result._is_negative = result._value.compareTo(BigInteger.ZERO) < 0;
|
||||
|
||||
|
||||
if (result._is_negative) {
|
||||
result._value = result._value.negate();
|
||||
result._is_negative = false;
|
||||
}
|
||||
|
||||
result._currency = this._currency.clone();
|
||||
|
||||
Reference in New Issue
Block a user