Small fixes.

This commit is contained in:
JoelKatz
2012-06-04 00:07:57 -07:00
parent b3f91fc7b2
commit 46f2248ce8
3 changed files with 6 additions and 6 deletions

View File

@@ -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<SHAMapItem>(trans->getID(), s.peekData());

View File

@@ -420,7 +420,7 @@ SHAMap::pointer LedgerConsensus::getTransactionTree(const uint256& hash, bool do
{
boost::unordered_map<uint256, SHAMap::pointer>::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];

View File

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