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
860184d5
Unverified
Commit
860184d5
authored
Jul 29, 2021
by
baptiste-b-pegasys
Committed by
GitHub
Jul 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
p2p: remove term "whitelist" (#23295)
Co-authored-by:
Felix Lange
<
fjl@twurst.com
>
parent
3526f690
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
7 deletions
+7
-7
dial.go
p2p/dial.go
+3
-3
common.go
p2p/discover/common.go
+1
-1
v4_udp.go
p2p/discover/v4_udp.go
+1
-1
server.go
p2p/server.go
+2
-2
No files found.
p2p/dial.go
View file @
860184d5
...
...
@@ -77,7 +77,7 @@ var (
errAlreadyDialing
=
errors
.
New
(
"already dialing"
)
errAlreadyConnected
=
errors
.
New
(
"already connected"
)
errRecentlyDialed
=
errors
.
New
(
"recently dialed"
)
errN
otWhitelisted
=
errors
.
New
(
"not contained in netrestrict white
list"
)
errN
etRestrict
=
errors
.
New
(
"not contained in netrestrict
list"
)
errNoPort
=
errors
.
New
(
"node does not provide TCP port"
)
)
...
...
@@ -133,7 +133,7 @@ type dialConfig struct {
self
enode
.
ID
// our own ID
maxDialPeers
int
// maximum number of dialed peers
maxActiveDials
int
// maximum number of active dials
netRestrict
*
netutil
.
Netlist
// IP
white
list, disabled if nil
netRestrict
*
netutil
.
Netlist
// IP
netrestrict
list, disabled if nil
resolver
nodeResolver
dialer
NodeDialer
log
log
.
Logger
...
...
@@ -402,7 +402,7 @@ func (d *dialScheduler) checkDial(n *enode.Node) error {
return
errAlreadyConnected
}
if
d
.
netRestrict
!=
nil
&&
!
d
.
netRestrict
.
Contains
(
n
.
IP
())
{
return
errN
otWhitelisted
return
errN
etRestrict
}
if
d
.
history
.
contains
(
string
(
n
.
ID
()
.
Bytes
()))
{
return
errRecentlyDialed
...
...
p2p/discover/common.go
View file @
860184d5
...
...
@@ -41,7 +41,7 @@ type Config struct {
PrivateKey
*
ecdsa
.
PrivateKey
// These settings are optional:
NetRestrict
*
netutil
.
Netlist
//
network whitelist
NetRestrict
*
netutil
.
Netlist
//
list of allowed IP networks
Bootnodes
[]
*
enode
.
Node
// list of bootstrap nodes
Unhandled
chan
<-
ReadPacket
// unhandled packets are sent on this channel
Log
log
.
Logger
// if set, log messages go here
...
...
p2p/discover/v4_udp.go
View file @
860184d5
...
...
@@ -583,7 +583,7 @@ func (t *UDPv4) nodeFromRPC(sender *net.UDPAddr, rn v4wire.Node) (*node, error)
return
nil
,
err
}
if
t
.
netrestrict
!=
nil
&&
!
t
.
netrestrict
.
Contains
(
rn
.
IP
)
{
return
nil
,
errors
.
New
(
"not contained in netrestrict
white
list"
)
return
nil
,
errors
.
New
(
"not contained in netrestrict list"
)
}
key
,
err
:=
v4wire
.
DecodePubkey
(
crypto
.
S256
(),
rn
.
ID
)
if
err
!=
nil
{
...
...
p2p/server.go
View file @
860184d5
...
...
@@ -353,7 +353,7 @@ func (srv *Server) RemovePeer(node *enode.Node) {
}
}
// AddTrustedPeer adds the given node to a reserved
white
list which allows the
// AddTrustedPeer adds the given node to a reserved
trusted
list which allows the
// node to always connect, even if the slot are full.
func
(
srv
*
Server
)
AddTrustedPeer
(
node
*
enode
.
Node
)
{
select
{
...
...
@@ -903,7 +903,7 @@ func (srv *Server) checkInboundConn(remoteIP net.IP) error {
}
// Reject connections that do not match NetRestrict.
if
srv
.
NetRestrict
!=
nil
&&
!
srv
.
NetRestrict
.
Contains
(
remoteIP
)
{
return
fmt
.
Errorf
(
"not
whitelisted in NetRestric
t"
)
return
fmt
.
Errorf
(
"not
in netrestrict lis
t"
)
}
// Reject Internet peers that try too often.
now
:=
srv
.
clock
.
Now
()
...
...
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