Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-p2p-swarm
Commits
7694d474
Unverified
Commit
7694d474
authored
Apr 02, 2020
by
Steven Allen
Committed by
GitHub
Apr 02, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #193 from libp2p/feat/backoff-cleanup
don't expire backoffs until 2x backoff period
parents
1c0adc36
b5d70683
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
swarm_dial.go
swarm_dial.go
+5
-1
No files found.
swarm_dial.go
View file @
7694d474
...
...
@@ -196,7 +196,11 @@ func (db *DialBackoff) cleanup() {
for
p
,
e
:=
range
db
.
entries
{
good
:=
false
for
_
,
backoff
:=
range
e
{
if
now
.
Before
(
backoff
.
until
)
{
backoffTime
:=
BackoffBase
+
BackoffCoef
*
time
.
Duration
(
backoff
.
tries
*
backoff
.
tries
)
if
backoffTime
>
BackoffMax
{
backoffTime
=
BackoffMax
}
if
now
.
Before
(
backoff
.
until
.
Add
(
backoffTime
))
{
good
=
true
break
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment