Fix currency and issuer for STAmount addition.

This commit is contained in:
Arthur Britto
2012-11-01 14:37:48 -07:00
parent f6a031b5a6
commit 47ed19777a

View File

@@ -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)