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
2e9c8fd4
Commit
2e9c8fd4
authored
Feb 27, 2018
by
Andrey Petrov
Committed by
Péter Szilágyi
Feb 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eth, les: allow exceeding maxPeers for trusted peers (#16189)
Fixes #3326, #14472
parent
4c845bdc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
handler.go
eth/handler.go
+2
-1
handler.go
les/handler.go
+2
-1
No files found.
eth/handler.go
View file @
2e9c8fd4
...
@@ -249,7 +249,8 @@ func (pm *ProtocolManager) newPeer(pv int, p *p2p.Peer, rw p2p.MsgReadWriter) *p
...
@@ -249,7 +249,8 @@ func (pm *ProtocolManager) newPeer(pv int, p *p2p.Peer, rw p2p.MsgReadWriter) *p
// handle is the callback invoked to manage the life cycle of an eth peer. When
// handle is the callback invoked to manage the life cycle of an eth peer. When
// this function terminates, the peer is disconnected.
// this function terminates, the peer is disconnected.
func
(
pm
*
ProtocolManager
)
handle
(
p
*
peer
)
error
{
func
(
pm
*
ProtocolManager
)
handle
(
p
*
peer
)
error
{
if
pm
.
peers
.
Len
()
>=
pm
.
maxPeers
{
// Ignore maxPeers if this is a trusted peer
if
pm
.
peers
.
Len
()
>=
pm
.
maxPeers
&&
!
p
.
Peer
.
Info
()
.
Network
.
Trusted
{
return
p2p
.
DiscTooManyPeers
return
p2p
.
DiscTooManyPeers
}
}
p
.
Log
()
.
Debug
(
"Ethereum peer connected"
,
"name"
,
p
.
Name
())
p
.
Log
()
.
Debug
(
"Ethereum peer connected"
,
"name"
,
p
.
Name
())
...
...
les/handler.go
View file @
2e9c8fd4
...
@@ -260,7 +260,8 @@ func (pm *ProtocolManager) newPeer(pv int, nv uint64, p *p2p.Peer, rw p2p.MsgRea
...
@@ -260,7 +260,8 @@ func (pm *ProtocolManager) newPeer(pv int, nv uint64, p *p2p.Peer, rw p2p.MsgRea
// handle is the callback invoked to manage the life cycle of a les peer. When
// handle is the callback invoked to manage the life cycle of a les peer. When
// this function terminates, the peer is disconnected.
// this function terminates, the peer is disconnected.
func
(
pm
*
ProtocolManager
)
handle
(
p
*
peer
)
error
{
func
(
pm
*
ProtocolManager
)
handle
(
p
*
peer
)
error
{
if
pm
.
peers
.
Len
()
>=
pm
.
maxPeers
{
// Ignore maxPeers if this is a trusted peer
if
pm
.
peers
.
Len
()
>=
pm
.
maxPeers
&&
!
p
.
Peer
.
Info
()
.
Network
.
Trusted
{
return
p2p
.
DiscTooManyPeers
return
p2p
.
DiscTooManyPeers
}
}
...
...
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