Browse Source

Merge pull request #1834 from jgarzik/kickblocks

P2P: Do not request blocks from peers with fewer blocks than us
miguelfreitas
Jeff Garzik 12 years ago
parent
commit
de2b9459bd
  1. 1
      src/main.cpp

1
src/main.cpp

@ -2513,6 +2513,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) @@ -2513,6 +2513,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
// Ask the first connected node for block updates
static int nAskedForBlocks = 0;
if (!pfrom->fClient && !pfrom->fOneShot &&
(pfrom->nStartingHeight > (nBestHeight - 144)) &&
(pfrom->nVersion < NOBLKS_VERSION_START ||
pfrom->nVersion >= NOBLKS_VERSION_END) &&
(nAskedForBlocks < 1 || vNodes.size() <= 1))

Loading…
Cancel
Save