Mostly cosmetic.

This commit is contained in:
Arthur Britto
2012-07-02 17:05:08 -07:00
parent 569edadeae
commit 9df8d6487c
3 changed files with 10 additions and 9 deletions

View File

@@ -12,6 +12,7 @@
#define SYSTEM_NAME "newcoin"
#define SYSTEM_CURRENCY_CODE "XNS"
#define SYSTEM_CURRENCY_PRECISION 6
#define SYSTEM_CURRENCY_CODE_RIPPLE "XNR"
#define SYSTEM_CURRENCY_GIFT 1000ull
#define SYSTEM_CURRENCY_USERS 100000000ull

View File

@@ -15,9 +15,7 @@ RippleState::RippleState(SerializedLedgerEntry::pointer ledgerEntry) :
mBalance = mLedgerEntry->getIValueFieldAmount(sfBalance);
// YYY Should never fail.
if (mLowID.isValid() && mHighID.isValid())
mValid = true;
mValid = true;
}
void RippleState::setViewAccount(const NewcoinAddress& naView)
@@ -27,7 +25,7 @@ void RippleState::setViewAccount(const NewcoinAddress& naView)
if (bViewLowestNew != mViewLowest)
{
mViewLowest = bViewLowestNew;
mBalance.changeSign();
mBalance.negate();
}
}

View File

@@ -206,10 +206,12 @@ class STAmount : public SerializedType
// Low 56 bits are value, legal range is 10^15 to (10^16 - 1) inclusive
protected:
uint160 mCurrency;
uint64 mValue;
int mOffset;
bool mIsNative, mIsNegative;
uint160 mCurrency;
uint64 mValue;
int mOffset;
bool mIsNative; // True for native stamps, ripple stamps are not native.
bool mIsNegative;
void canonicalize();
STAmount* duplicate() const { return new STAmount(*this); }
@@ -277,7 +279,7 @@ public:
bool isGEZero() const { return !mIsNegative; }
operator bool() const { return !isZero(); }
void changeSign() { if (!isZero()) mIsNegative = !mIsNegative; }
void negate() { if (!isZero()) mIsNegative = !mIsNegative; }
void zero() { mOffset = mIsNative ? -100 : 0; mValue = 0; mIsNegative = false; }
const uint160& getCurrency() const { return mCurrency; }