Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mybee
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
mybee
Commits
b71302a0
Unverified
Commit
b71302a0
authored
May 24, 2021
by
Esad Akar
Committed by
GitHub
May 24, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: missing knownPeers remove (#1859)
parent
5cb66fe0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
kademlia.go
pkg/topology/kademlia/kademlia.go
+2
-2
No files found.
pkg/topology/kademlia/kademlia.go
View file @
b71302a0
...
...
@@ -341,8 +341,7 @@ func (k *Kad) connectionAttemptsHandler(ctx context.Context, wg *sync.WaitGroup,
switch
{
case
errors
.
Is
(
err
,
addressbook
.
ErrNotFound
)
:
k
.
logger
.
Debugf
(
"kademlia: empty address book entry for peer %q"
,
peer
.
addr
)
po
:=
swarm
.
Proximity
(
k
.
base
.
Bytes
(),
peer
.
addr
.
Bytes
())
k
.
knownPeers
.
Remove
(
peer
.
addr
,
po
)
k
.
knownPeers
.
Remove
(
peer
.
addr
,
swarm
.
Proximity
(
k
.
base
.
Bytes
(),
peer
.
addr
.
Bytes
()))
return
case
err
!=
nil
:
k
.
logger
.
Debugf
(
"kademlia: failed to get address book entry for peer %q: %v"
,
peer
.
addr
,
err
)
...
...
@@ -695,6 +694,7 @@ func (k *Kad) connect(ctx context.Context, peer swarm.Address, ma ma.Multiaddr)
quickPrune
:=
ss
==
nil
||
ss
.
HasAtMaxOneConnectionAttempt
()
if
(
k
.
connectedPeers
.
Length
()
>
0
&&
quickPrune
)
||
failedAttempts
>
maxConnAttempts
{
delete
(
k
.
waitNext
,
peer
.
ByteString
())
k
.
knownPeers
.
Remove
(
peer
,
swarm
.
Proximity
(
k
.
base
.
Bytes
(),
peer
.
Bytes
()))
if
err
:=
k
.
addressBook
.
Remove
(
peer
);
err
!=
nil
{
k
.
logger
.
Debugf
(
"could not remove peer from addressbook: %q"
,
peer
)
}
...
...
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