mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-25 21:45:52 +00:00
Cleanups:
* Use Throw instead of directly throwing an exception
This commit is contained in:
@@ -412,17 +412,15 @@ void LedgerConsensusImp::mapCompleteInternal (
|
|||||||
// this will create disputed transactions
|
// this will create disputed transactions
|
||||||
auto it2 = mAcquired.find (mOurPosition->getCurrentHash ());
|
auto it2 = mAcquired.find (mOurPosition->getCurrentHash ());
|
||||||
|
|
||||||
if (it2 != mAcquired.end ())
|
if (it2 == mAcquired.end())
|
||||||
{
|
LogicError ("We cannot find our own position!");
|
||||||
|
|
||||||
assert ((it2->first == mOurPosition->getCurrentHash ())
|
assert ((it2->first == mOurPosition->getCurrentHash ())
|
||||||
&& it2->second);
|
&& it2->second);
|
||||||
mCompares.insert(hash);
|
mCompares.insert(hash);
|
||||||
// Our position is not the same as the acquired position
|
// Our position is not the same as the acquired position
|
||||||
createDisputes (it2->second, map);
|
createDisputes (it2->second, map);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
assert (false); // We don't have our own position?!
|
|
||||||
}
|
|
||||||
else if (!mOurPosition)
|
else if (!mOurPosition)
|
||||||
JLOG (j_.debug)
|
JLOG (j_.debug)
|
||||||
<< "Not creating disputes: no position yet.";
|
<< "Not creating disputes: no position yet.";
|
||||||
@@ -437,9 +435,10 @@ void LedgerConsensusImp::mapCompleteInternal (
|
|||||||
|
|
||||||
// Adjust tracking for each peer that takes this position
|
// Adjust tracking for each peer that takes this position
|
||||||
std::vector<NodeID> peers;
|
std::vector<NodeID> peers;
|
||||||
|
auto const mapHash = map->getHash ().as_uint256();
|
||||||
for (auto& it : mPeerPositions)
|
for (auto& it : mPeerPositions)
|
||||||
{
|
{
|
||||||
if (it.second->getCurrentHash () == map->getHash ().as_uint256())
|
if (it.second->getCurrentHash () == mapHash)
|
||||||
peers.push_back (it.second->getPeerID ());
|
peers.push_back (it.second->getPeerID ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -448,7 +448,7 @@ void
|
|||||||
SerialIter::skip (int length)
|
SerialIter::skip (int length)
|
||||||
{
|
{
|
||||||
if (remain_ < length)
|
if (remain_ < length)
|
||||||
throw std::runtime_error(
|
Throw<std::runtime_error> (
|
||||||
"invalid SerialIter skip");
|
"invalid SerialIter skip");
|
||||||
p_ += length;
|
p_ += length;
|
||||||
used_ += length;
|
used_ += length;
|
||||||
|
|||||||
Reference in New Issue
Block a user