mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
Cleanups.
This commit is contained in:
@@ -393,7 +393,7 @@ void LedgerMaster::getFetchPack (Ledger::ref nextLedger)
|
||||
target->sendPacket (packet, false);
|
||||
}
|
||||
else
|
||||
WriteLog (lsTRACE, LedgerMaster) << "No peer for fetch pack";
|
||||
WriteLog (lsDEBUG, LedgerMaster) << "No peer for fetch pack";
|
||||
}
|
||||
|
||||
bool LedgerMaster::shouldAcquire (uint32 currentLedger, uint32 ledgerHistory, uint32 candidateLedger)
|
||||
|
||||
@@ -26,25 +26,16 @@ InboundLedger::InboundLedger (uint256 const& hash, uint32 seq)
|
||||
#ifdef LA_DEBUG
|
||||
WriteLog (lsTRACE, InboundLedger) << "Acquiring ledger " << mHash;
|
||||
#endif
|
||||
tryLocal ();
|
||||
if (tryLocal ())
|
||||
done();
|
||||
}
|
||||
|
||||
// Returns true if progress is made
|
||||
bool InboundLedger::checkLocal ()
|
||||
void InboundLedger::checkLocal ()
|
||||
{
|
||||
bool ret = false;
|
||||
boost::recursive_mutex::scoped_lock sl (mLock);
|
||||
|
||||
{
|
||||
boost::recursive_mutex::scoped_lock sl (mLock);
|
||||
|
||||
if (!isDone () && tryLocal())
|
||||
{
|
||||
done();
|
||||
ret = true;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
if (!isDone () && tryLocal())
|
||||
done();
|
||||
}
|
||||
|
||||
bool InboundLedger::tryLocal ()
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
void addPeers ();
|
||||
void awaitData ();
|
||||
void noAwaitData ();
|
||||
bool checkLocal ();
|
||||
void checkLocal ();
|
||||
|
||||
typedef std::pair <protocol::TMGetObjectByHash::ObjectType, uint256> neededHash_t;
|
||||
|
||||
|
||||
@@ -257,15 +257,10 @@ void InboundLedgers::gotFetchPack (Job&)
|
||||
acquires.push_back (it.second);
|
||||
}
|
||||
|
||||
bool progress = false;
|
||||
BOOST_FOREACH (const InboundLedger::pointer & acquire, acquires)
|
||||
{
|
||||
if (acquire->checkLocal ())
|
||||
progress = true;
|
||||
acquire->checkLocal ();
|
||||
}
|
||||
|
||||
if (progress)
|
||||
getApp().getLedgerMaster().tryAdvance();
|
||||
}
|
||||
|
||||
void InboundLedgers::clearFailures ()
|
||||
|
||||
Reference in New Issue
Block a user