From e364ad962f40afb091db5f03a0c48342063672a0 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 759e514ca81..c2decc339d9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1508,10 +1508,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;