mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-29 15:35:50 +00:00
Fetch a bit better.
This commit is contained in:
@@ -613,6 +613,16 @@ void LedgerMaster::advanceThread()
|
||||
tryFill(ledger);
|
||||
progress = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < getConfig().getSize(siLedgerFetch); ++i)
|
||||
{
|
||||
uint32 seq = missing - i;
|
||||
uint256 hash = nextLedger->getLedgerHash(seq);
|
||||
if (hash.isNonZero())
|
||||
getApp().getInboundLedgers().findCreate(hash, seq);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -170,7 +170,7 @@ void InboundLedger::onTimer (bool progress, boost::recursive_mutex::scoped_lock&
|
||||
WriteLog (lsDEBUG, InboundLedger) << "No progress(" << pc << ") for ledger " << mHash;
|
||||
|
||||
trigger (Peer::pointer ());
|
||||
if (pc < 3)
|
||||
if (pc < 4)
|
||||
addPeers ();
|
||||
}
|
||||
}
|
||||
@@ -212,13 +212,13 @@ void InboundLedger::addPeers ()
|
||||
|
||||
if (peer->hasLedger (getHash (), mSeq))
|
||||
{
|
||||
if (peerHas (peer) && (++found == 3))
|
||||
if (peerHas (peer) && (++found > 6))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
for (int i = 0; i < ((vSize > 6) ? 6 : vSize); ++i)
|
||||
for (int i = 0; (i < 6) && (i < vSize); ++i)
|
||||
peerHas (peerList[ (i + firstPeer) % vSize]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user