aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorEthan Heilman <Ethan.R.Heilman@gmail.com>2016-06-17 00:10:07 -0400
committerPieter Wuille <pieter.wuille@gmail.com>2016-09-07 16:17:40 +0200
commit2611ad79a5d53e2ce1535b342a9b72c2888a6c3f (patch)
treea96504ebeeba38b23c87c99c803a9310858070d0 /src/main.cpp
parent1db3352cc663f6a25a39813c763a2f6263f55e6d (diff)
downloadbitcoin-2611ad79a5d53e2ce1535b342a9b72c2888a6c3f.tar.xz
Added feeler connections increasing good addrs in the tried table.
Tests if addresses are online or offline by briefly connecting to them. These short lived connections are referred to as feeler connections. Feeler connections are designed to increase the number of fresh online addresses in tried by selecting and connecting to addresses in new. One feeler connection is attempted on average once every two minutes. This change was suggested as Countermeasure 4 in Eclipse Attacks on Bitcoin’s Peer-to-Peer Network, Ethan Heilman, Alison Kendler, Aviv Zohar, Sharon Goldberg. ePrint Archive Report 2015/263. March 2015.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 7ddf52fc55..e3be69ad24 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -4917,6 +4917,12 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
if (strCommand == NetMsgType::VERSION)
{
+ // Feeler connections exist only to verify if address is online.
+ if (pfrom->fFeeler) {
+ assert(pfrom->fInbound == false);
+ pfrom->fDisconnect = true;
+ }
+
// Each connection can only send one version message
if (pfrom->nVersion != 0)
{