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);
|
target->sendPacket (packet, false);
|
||||||
}
|
}
|
||||||
else
|
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)
|
bool LedgerMaster::shouldAcquire (uint32 currentLedger, uint32 ledgerHistory, uint32 candidateLedger)
|
||||||
|
|||||||
@@ -26,25 +26,16 @@ InboundLedger::InboundLedger (uint256 const& hash, uint32 seq)
|
|||||||
#ifdef LA_DEBUG
|
#ifdef LA_DEBUG
|
||||||
WriteLog (lsTRACE, InboundLedger) << "Acquiring ledger " << mHash;
|
WriteLog (lsTRACE, InboundLedger) << "Acquiring ledger " << mHash;
|
||||||
#endif
|
#endif
|
||||||
tryLocal ();
|
if (tryLocal ())
|
||||||
|
done();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns true if progress is made
|
void InboundLedger::checkLocal ()
|
||||||
bool InboundLedger::checkLocal ()
|
|
||||||
{
|
{
|
||||||
bool ret = false;
|
boost::recursive_mutex::scoped_lock sl (mLock);
|
||||||
|
|
||||||
{
|
if (!isDone () && tryLocal())
|
||||||
boost::recursive_mutex::scoped_lock sl (mLock);
|
done();
|
||||||
|
|
||||||
if (!isDone () && tryLocal())
|
|
||||||
{
|
|
||||||
done();
|
|
||||||
ret = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InboundLedger::tryLocal ()
|
bool InboundLedger::tryLocal ()
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ public:
|
|||||||
void addPeers ();
|
void addPeers ();
|
||||||
void awaitData ();
|
void awaitData ();
|
||||||
void noAwaitData ();
|
void noAwaitData ();
|
||||||
bool checkLocal ();
|
void checkLocal ();
|
||||||
|
|
||||||
typedef std::pair <protocol::TMGetObjectByHash::ObjectType, uint256> neededHash_t;
|
typedef std::pair <protocol::TMGetObjectByHash::ObjectType, uint256> neededHash_t;
|
||||||
|
|
||||||
|
|||||||
@@ -257,15 +257,10 @@ void InboundLedgers::gotFetchPack (Job&)
|
|||||||
acquires.push_back (it.second);
|
acquires.push_back (it.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool progress = false;
|
|
||||||
BOOST_FOREACH (const InboundLedger::pointer & acquire, acquires)
|
BOOST_FOREACH (const InboundLedger::pointer & acquire, acquires)
|
||||||
{
|
{
|
||||||
if (acquire->checkLocal ())
|
acquire->checkLocal ();
|
||||||
progress = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (progress)
|
|
||||||
getApp().getLedgerMaster().tryAdvance();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void InboundLedgers::clearFailures ()
|
void InboundLedgers::clearFailures ()
|
||||||
|
|||||||
Reference in New Issue
Block a user