aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorEthan Heilman <[email protected]>2016-06-17 00:10:07 -0400
committerEthanHeilman <[email protected]>2016-08-23 16:26:42 -0400
commitdbb1f640e67da25f0a41b9d2e696b789d2fd4e0d (patch)
tree1f2478a03fa0005d04411ee3c8b671263e319a2a /src/main.cpp
parentMerge #8453: Bring secp256k1 subtree up to date with master (diff)
downloaddiscoin-dbb1f640e67da25f0a41b9d2e696b789d2fd4e0d.tar.xz
discoin-dbb1f640e67da25f0a41b9d2e696b789d2fd4e0d.zip
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 75f991d31..758a6dcce 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -4903,6 +4903,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)
{