Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
张蕾
Geth-Modification
Commits
81106719
Commit
81106719
authored
May 02, 2016
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
p2p/discover: prevent bonding self
parent
32bb2801
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
table.go
p2p/discover/table.go
+4
-0
No files found.
p2p/discover/table.go
View file @
81106719
...
...
@@ -25,6 +25,7 @@ package discover
import
(
"crypto/rand"
"encoding/binary"
"errors"
"fmt"
"net"
"sort"
...
...
@@ -457,6 +458,9 @@ func (tab *Table) bondall(nodes []*Node) (result []*Node) {
// If pinged is true, the remote node has just pinged us and one half
// of the process can be skipped.
func
(
tab
*
Table
)
bond
(
pinged
bool
,
id
NodeID
,
addr
*
net
.
UDPAddr
,
tcpPort
uint16
)
(
*
Node
,
error
)
{
if
id
==
tab
.
self
.
ID
{
return
nil
,
errors
.
New
(
"is self"
)
}
// Retrieve a previously known node and any recent findnode failures
node
,
fails
:=
tab
.
db
.
node
(
id
),
0
if
node
!=
nil
{
...
...
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