mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Start of STAmount issuer fixes.
This commit is contained in:
@@ -359,19 +359,16 @@ STAmount* STAmount::construct(SerializerIterator& sit, const char *name)
|
||||
if ((value < cMinValue) || (value > cMaxValue) || (offset < cMinOffset) || (offset > cMaxOffset))
|
||||
throw std::runtime_error("invalid currency value");
|
||||
|
||||
sapResult = new STAmount(name, uCurrencyID, value, offset, isNegative);
|
||||
sapResult = new STAmount(name, uCurrencyID, uIssuerID, value, offset, isNegative);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (offset != 512)
|
||||
throw std::runtime_error("invalid currency value");
|
||||
|
||||
sapResult = new STAmount(name, uCurrencyID);
|
||||
sapResult = new STAmount(name, uCurrencyID, uIssuerID);
|
||||
}
|
||||
|
||||
if (sapResult)
|
||||
sapResult->setIssuer(uIssuerID);
|
||||
|
||||
return sapResult;
|
||||
}
|
||||
|
||||
@@ -522,7 +519,22 @@ STAmount& STAmount::operator-=(const STAmount& a)
|
||||
STAmount STAmount::operator-(void) const
|
||||
{
|
||||
if (mValue == 0) return *this;
|
||||
return STAmount(name, mCurrency, mValue, mOffset, mIsNative, !mIsNegative);
|
||||
return STAmount(name, mCurrency, mIssuer, mValue, mOffset, mIsNative, !mIsNegative);
|
||||
}
|
||||
|
||||
STAmount& STAmount::operator=(const STAmount &a)
|
||||
{
|
||||
if (name == NULL)
|
||||
name = a.name;
|
||||
|
||||
mCurrency = a.mCurrency;
|
||||
mIssuer = a.mIssuer;
|
||||
mValue = a.mValue;
|
||||
mOffset = a.mOffset;
|
||||
mIsNative = a.mIsNative;
|
||||
mIsNegative = a.mIsNegative;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
STAmount& STAmount::operator=(uint64 v)
|
||||
|
||||
Reference in New Issue
Block a user