From 93dd68e924c7cf24b75bfb5b83b1be1cdc27dbdc Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Mon, 24 Sep 2012 13:26:09 -0400 Subject: [PATCH] P2P: Do not request blocks from peers with fewer blocks than us If the remote node has a shorter chain, do not waste our special getblocks request on them. --- src/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.cpp b/src/main.cpp index fbaf05df..206d85e5 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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))