From 1de2a46632946990a7863020b61172232f8c5796 Mon Sep 17 00:00:00 2001 From: Suhas Daftuar Date: Tue, 26 Jul 2016 16:50:48 -0400 Subject: [PATCH 1/2] Ignore GETBLOCKTXN requests for unknown blocks Don't disconnect peers, or else we leak information that could be used for fingerprinting. --- src/main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 052b739326..4675127ec3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5343,7 +5343,6 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, BlockMap::iterator it = mapBlockIndex.find(req.blockhash); if (it == mapBlockIndex.end() || !(it->second->nStatus & BLOCK_HAVE_DATA)) { - Misbehaving(pfrom->GetId(), 100); LogPrintf("Peer %d sent us a getblocktxn for a block we don't have", pfrom->id); return true; } From 1d06e49834814eed45e07393dcffd7b6683311b2 Mon Sep 17 00:00:00 2001 From: Suhas Daftuar Date: Tue, 26 Jul 2016 16:52:35 -0400 Subject: [PATCH 2/2] Ignore CMPCTBLOCK messages for pruned blocks Also ignores CMPCTBLOCK announcements that have too little work. This is to prevent disk-exhaustion DoS. --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 4675127ec3..b41a719552 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5626,8 +5626,8 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, std::vector vInv(1); vInv[0] = CInv(MSG_BLOCK, cmpctblock.header.GetHash()); pfrom->PushMessage(NetMsgType::GETDATA, vInv); - return true; } + return true; } // If we're not close to tip yet, give up and let parallel block fetch work its magic