diff --git a/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp b/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp index a4202eb7b..0de15b6c1 100644 --- a/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp +++ b/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp @@ -412,16 +412,14 @@ void LedgerConsensusImp::mapCompleteInternal ( // this will create disputed transactions auto it2 = mAcquired.find (mOurPosition->getCurrentHash ()); - if (it2 != mAcquired.end ()) - { - assert ((it2->first == mOurPosition->getCurrentHash ()) - && it2->second); - mCompares.insert(hash); - // Our position is not the same as the acquired position - createDisputes (it2->second, map); - } - else - assert (false); // We don't have our own position?! + if (it2 == mAcquired.end()) + LogicError ("We cannot find our own position!"); + + assert ((it2->first == mOurPosition->getCurrentHash ()) + && it2->second); + mCompares.insert(hash); + // Our position is not the same as the acquired position + createDisputes (it2->second, map); } else if (!mOurPosition) JLOG (j_.debug) @@ -437,9 +435,10 @@ void LedgerConsensusImp::mapCompleteInternal ( // Adjust tracking for each peer that takes this position std::vector peers; + auto const mapHash = map->getHash ().as_uint256(); for (auto& it : mPeerPositions) { - if (it.second->getCurrentHash () == map->getHash ().as_uint256()) + if (it.second->getCurrentHash () == mapHash) peers.push_back (it.second->getPeerID ()); } diff --git a/src/ripple/protocol/impl/Serializer.cpp b/src/ripple/protocol/impl/Serializer.cpp index b4c59d5d3..b2ca88f4c 100644 --- a/src/ripple/protocol/impl/Serializer.cpp +++ b/src/ripple/protocol/impl/Serializer.cpp @@ -448,7 +448,7 @@ void SerialIter::skip (int length) { if (remain_ < length) - throw std::runtime_error( + Throw ( "invalid SerialIter skip"); p_ += length; used_ += length;