Skip to content

Commit

Permalink
Use last checkpoint instead of hard-coded 140,700. Fixes #913.
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinandresen committed Mar 20, 2012
1 parent 3f1bb1a commit eae82d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1706,10 +1706,11 @@ bool CBlock::AcceptBlock()
return error("AcceptBlock() : AddToBlockIndex failed");

// Relay inventory, but don't relay old inventory during initial block download
int nBlockEstimate = Checkpoints::GetTotalBlocksEstimate();
if (hashBestChain == hash)
CRITICAL_BLOCK(cs_vNodes)
BOOST_FOREACH(CNode* pnode, vNodes)
if (nBestHeight > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : 140700))
if (nBestHeight > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : nBlockEstimate))
pnode->PushInventory(CInv(MSG_BLOCK, hash));

return true;
Expand Down

0 comments on commit eae82d8

Please sign in to comment.