Fetch a bit better.

This commit is contained in:
JoelKatz
2013-08-14 02:01:55 -07:00
parent bed027d852
commit 5a81b0a4a8
2 changed files with 13 additions and 3 deletions

View File

@@ -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
{

View File

@@ -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]);
}