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
b8aeb04f
Commit
b8aeb04f
authored
Apr 13, 2015
by
Felix Lange
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
p2p/discover: remove unused field Node.activeStamp
parent
b9929d28
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
16 deletions
+0
-16
node.go
p2p/discover/node.go
+0
-15
table.go
p2p/discover/table.go
+0
-1
No files found.
p2p/discover/node.go
View file @
b8aeb04f
...
@@ -14,8 +14,6 @@ import (
...
@@ -14,8 +14,6 @@ import (
"strconv"
"strconv"
"strings"
"strings"
"sync"
"sync"
"sync/atomic"
"time"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto/secp256k1"
"github.com/ethereum/go-ethereum/crypto/secp256k1"
...
@@ -31,9 +29,6 @@ type Node struct {
...
@@ -31,9 +29,6 @@ type Node struct {
DiscPort
int
// UDP listening port for discovery protocol
DiscPort
int
// UDP listening port for discovery protocol
TCPPort
int
// TCP listening port for RLPx
TCPPort
int
// TCP listening port for RLPx
// this must be set/read using atomic load and store.
activeStamp
int64
}
}
func
newNode
(
id
NodeID
,
addr
*
net
.
UDPAddr
)
*
Node
{
func
newNode
(
id
NodeID
,
addr
*
net
.
UDPAddr
)
*
Node
{
...
@@ -50,16 +45,6 @@ func (n *Node) isValid() bool {
...
@@ -50,16 +45,6 @@ func (n *Node) isValid() bool {
return
!
n
.
IP
.
IsMulticast
()
&&
!
n
.
IP
.
IsUnspecified
()
&&
n
.
TCPPort
!=
0
&&
n
.
DiscPort
!=
0
return
!
n
.
IP
.
IsMulticast
()
&&
!
n
.
IP
.
IsUnspecified
()
&&
n
.
TCPPort
!=
0
&&
n
.
DiscPort
!=
0
}
}
func
(
n
*
Node
)
bumpActive
()
{
stamp
:=
time
.
Now
()
.
Unix
()
atomic
.
StoreInt64
(
&
n
.
activeStamp
,
stamp
)
}
func
(
n
*
Node
)
active
()
time
.
Time
{
stamp
:=
atomic
.
LoadInt64
(
&
n
.
activeStamp
)
return
time
.
Unix
(
stamp
,
0
)
}
func
(
n
*
Node
)
addr
()
*
net
.
UDPAddr
{
func
(
n
*
Node
)
addr
()
*
net
.
UDPAddr
{
return
&
net
.
UDPAddr
{
IP
:
n
.
IP
,
Port
:
n
.
DiscPort
}
return
&
net
.
UDPAddr
{
IP
:
n
.
IP
,
Port
:
n
.
DiscPort
}
}
}
...
...
p2p/discover/table.go
View file @
b8aeb04f
...
@@ -326,7 +326,6 @@ outer:
...
@@ -326,7 +326,6 @@ outer:
func
(
b
*
bucket
)
bump
(
n
*
Node
)
bool
{
func
(
b
*
bucket
)
bump
(
n
*
Node
)
bool
{
for
i
:=
range
b
.
entries
{
for
i
:=
range
b
.
entries
{
if
b
.
entries
[
i
]
.
ID
==
n
.
ID
{
if
b
.
entries
[
i
]
.
ID
==
n
.
ID
{
n
.
bumpActive
()
// move it to the front
// move it to the front
copy
(
b
.
entries
[
1
:
],
b
.
entries
[
:
i
])
copy
(
b
.
entries
[
1
:
],
b
.
entries
[
:
i
])
b
.
entries
[
0
]
=
n
b
.
entries
[
0
]
=
n
...
...
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