aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGregory Maxwell <gmaxwell@gmail.com>2012-03-20 14:26:32 -0700
committerGregory Maxwell <gmaxwell@gmail.com>2012-03-20 14:26:32 -0700
commitef142365392f57b6d6d0c54186dc7f2fc9242bec (patch)
tree7ba6bfd4d7aee84ebf1a297d915e355fa96467b0 /src
parent3f1bb1ac788cd8a9b39a06f4c8fa48b466dda1d2 (diff)
parenteae82d8ee5ce95e4f87d4fdafcb00ecce5b533a9 (diff)
downloadbitcoin-ef142365392f57b6d6d0c54186dc7f2fc9242bec.tar.xz
Merge pull request #960 from gavinandresen/issue913
Use last checkpoint instead of hard-coded 140,700. Fixes #913.
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 1209f6e568..babdf88f77 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -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;