Arthur found a missing constructor that breaks handling negative native amounts.

This commit is contained in:
JoelKatz
2013-02-11 21:24:42 -08:00
parent 0d03c1fb4a
commit 1dedb2b190

View File

@@ -249,6 +249,18 @@ public:
: SerializedType(n), mValue(v), mOffset(0), mIsNative(true), mIsNegative(isNeg) : SerializedType(n), mValue(v), mOffset(0), mIsNative(true), mIsNegative(isNeg)
{ ; } { ; }
STAmount(SField::ref n, int64 v)
: SerializedType(n), mOffset(0), mIsNative(true), mIsNegative(false)
{
if (v < 0)
{
mIsNegative = true;
mValue = static_cast<uint64_t>(-v);
}
else
mValue = static_cast<uint64_t>(v);
}
STAmount(const uint160& uCurrencyID, const uint160& uIssuerID, uint64 uV = 0, int iOff = 0, bool bNegative = false) STAmount(const uint160& uCurrencyID, const uint160& uIssuerID, uint64 uV = 0, int iOff = 0, bool bNegative = false)
: mCurrency(uCurrencyID), mIssuer(uIssuerID), mValue(uV), mOffset(iOff), mIsNegative(bNegative) : mCurrency(uCurrencyID), mIssuer(uIssuerID), mValue(uV), mOffset(iOff), mIsNegative(bNegative)
{ canonicalize(); } { canonicalize(); }