From 320ecea6a079bd77521049a00e485ae85499c02c Mon Sep 17 00:00:00 2001 From: David Hill Date: Wed, 8 Apr 2015 15:52:36 -0400 Subject: [PATCH] addrmgr: Do not bias toward fresh addresses. This change was suggested as Countermeasure 2 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. This mimics Bitcoin Core commit f68ba3f67bd500a64fb8932c6b41924ddc31d76f --- addrmgr/knownaddress.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addrmgr/knownaddress.go b/addrmgr/knownaddress.go index 28b559ff..ea843122 100644 --- a/addrmgr/knownaddress.go +++ b/addrmgr/knownaddress.go @@ -48,7 +48,7 @@ func (ka *KnownAddress) chance() float64 { lastAttempt = 0 } - c := 600.0 / (600.0 + lastSeen.Seconds()) + c := 1.0 // Very recent attempts are less likely to be retried. if lastAttempt > 10*time.Minute {