mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-27 03:33:27 -03:00
Merge pull request #960 from gavinandresen/issue913
Use last checkpoint instead of hard-coded 140,700. Fixes #913.
This commit is contained in:
commit
ef14236539
1 changed files with 2 additions and 1 deletions
|
@ -1706,10 +1706,11 @@ bool CBlock::AcceptBlock()
|
||||||
return error("AcceptBlock() : AddToBlockIndex failed");
|
return error("AcceptBlock() : AddToBlockIndex failed");
|
||||||
|
|
||||||
// Relay inventory, but don't relay old inventory during initial block download
|
// Relay inventory, but don't relay old inventory during initial block download
|
||||||
|
int nBlockEstimate = Checkpoints::GetTotalBlocksEstimate();
|
||||||
if (hashBestChain == hash)
|
if (hashBestChain == hash)
|
||||||
CRITICAL_BLOCK(cs_vNodes)
|
CRITICAL_BLOCK(cs_vNodes)
|
||||||
BOOST_FOREACH(CNode* pnode, 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));
|
pnode->PushInventory(CInv(MSG_BLOCK, hash));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue