minor fix to batched initial download in case requester has more than 500 block non-main branch

This commit is contained in:
s_nakamoto
2009-11-24 21:04:50 +00:00
parent e4db374421
commit 70918a6645
3 changed files with 24 additions and 3 deletions

View File

@@ -1960,8 +1960,8 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
// Send the rest of the chain
if (pindex)
pindex = pindex->pnext;
printf("getblocks %d to %s\n", (pindex ? pindex->nHeight : -1), hashStop.ToString().substr(0,16).c_str());
int nLimit = 500;
int nLimit = 500 + locator.GetDistanceBack();
printf("getblocks %d to %s limit %d\n", (pindex ? pindex->nHeight : -1), hashStop.ToString().substr(0,16).c_str(), nLimit);
for (; pindex; pindex = pindex->pnext)
{
if (pindex->GetBlockHash() == hashStop)