mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Fix currency and issuer for STAmount addition.
This commit is contained in:
@@ -773,8 +773,12 @@ STAmount::operator double() const
|
||||
|
||||
STAmount operator+(const STAmount& v1, const STAmount& v2)
|
||||
{
|
||||
if (v1.isZero()) return v2;
|
||||
if (v2.isZero()) return v1;
|
||||
if (v1.isZero())
|
||||
{
|
||||
// Result must be in terms of v1 currency and issuer.
|
||||
return STAmount(v1.getFName(), v1.mCurrency, v1.mIssuer, v2.mValue, v2.mOffset, v2.mIsNegative);
|
||||
}
|
||||
|
||||
v1.throwComparable(v2);
|
||||
if (v1.mIsNative)
|
||||
|
||||
Reference in New Issue
Block a user