Skip to content

Commit ef14236

Browse files
committed
Merge pull request #960 from gavinandresen/issue913
Use last checkpoint instead of hard-coded 140,700. Fixes #913.
2 parents 3f1bb1a + eae82d8 commit ef14236

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1706,10 +1706,11 @@ bool CBlock::AcceptBlock()
17061706
return error("AcceptBlock() : AddToBlockIndex failed");
17071707

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

17151716
return true;

0 commit comments

Comments
 (0)