From 46f2248ce89e1b5be27a9b0dec926d0806a1294c Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Mon, 4 Jun 2012 00:07:57 -0700 Subject: [PATCH] Small fixes. --- src/Ledger.cpp | 6 +++--- src/LedgerConsensus.cpp | 2 +- src/LedgerIndex.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Ledger.cpp b/src/Ledger.cpp index 431eea5db0..1fda2ca217 100644 --- a/src/Ledger.cpp +++ b/src/Ledger.cpp @@ -41,7 +41,7 @@ Ledger::Ledger(const uint256 &parentHash, const uint256 &transHash, const uint25 mTotCoins(totCoins), mCloseTime(timeStamp), mLedgerSeq(ledgerSeq), mLedgerInterval(LEDGER_INTERVAL), mClosed(false), mValidHash(false), mAccepted(false), mImmutable(false) { - assert(!!mParentHash); + assert(mParentHash.isNonZero()); updateHash(); } @@ -62,7 +62,7 @@ Ledger::Ledger(bool, Ledger& prevLedger) : mTotCoins(prevLedger.mTotCoins), { // Create a new ledger that follows this one prevLedger.updateHash(); mParentHash = prevLedger.getHash(); - assert(!!mParentHash); + assert(mParentHash.isNonZero()); mCloseTime = prevLedger.getNextLedgerClose(); } @@ -171,7 +171,7 @@ RippleState::pointer Ledger::getRippleState(const uint256& uNode) bool Ledger::addTransaction(Transaction::pointer trans) { // low-level - just add to table assert(!mAccepted); - assert(!!trans->getID()); + assert(trans->getID().isNonZero()); Serializer s; trans->getSTransaction()->add(s); SHAMapItem::pointer item = boost::make_shared(trans->getID(), s.peekData()); diff --git a/src/LedgerConsensus.cpp b/src/LedgerConsensus.cpp index f5b8afb162..e2c95fbe84 100644 --- a/src/LedgerConsensus.cpp +++ b/src/LedgerConsensus.cpp @@ -420,7 +420,7 @@ SHAMap::pointer LedgerConsensus::getTransactionTree(const uint256& hash, bool do { boost::unordered_map::iterator it = mComplete.find(hash); if (it == mComplete.end()) - { // we have not completed acuiqiring this ledger + { // we have not completed acquiring this ledger if (doAcquire) { TransactionAcquire::pointer& acquiring = mAcquiring[hash]; diff --git a/src/LedgerIndex.cpp b/src/LedgerIndex.cpp index 9037ce125f..89d78ed2a3 100644 --- a/src/LedgerIndex.cpp +++ b/src/LedgerIndex.cpp @@ -49,8 +49,8 @@ uint256 Ledger::getGeneratorIndex(const uint160& uGeneratorID) uint160 Ledger::getOfferBase(const uint160& currencyIn, const uint160& accountIn, const uint160& currencyOut, const uint160& accountOut) { - bool inNative = !!currencyIn; - bool outNative = !!currencyOut; + bool inNative = currencyIn.isZero(); + bool outNative = currencyOut.isZero(); if (inNative && outNative) throw std::runtime_error("native to native offer");