From eae82d8ee5ce95e4f87d4fdafcb00ecce5b533a9 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Tue, 20 Mar 2012 13:45:45 -0400 Subject: [PATCH] Use last checkpoint instead of hard-coded 140,700. Fixes #913. --- src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 1209f6e5..babdf88f 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;