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
546d4217
Commit
546d4217
authored
Jun 12, 2018
by
Felföldi Zsolt
Committed by
Péter Szilágyi
Jun 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
les: pass server pool to protocol manager (#16947)
parent
f9919959
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
4 deletions
+5
-4
backend.go
les/backend.go
+1
-1
handler.go
les/handler.go
+2
-1
helper_test.go
les/helper_test.go
+1
-1
server.go
les/server.go
+1
-1
No files found.
les/backend.go
View file @
546d4217
...
...
@@ -127,7 +127,7 @@ func New(ctx *node.ServiceContext, config *eth.Config) (*LightEthereum, error) {
}
leth
.
txPool
=
light
.
NewTxPool
(
leth
.
chainConfig
,
leth
.
blockchain
,
leth
.
relay
)
if
leth
.
protocolManager
,
err
=
NewProtocolManager
(
leth
.
chainConfig
,
true
,
ClientProtocolVersions
,
config
.
NetworkId
,
leth
.
eventMux
,
leth
.
engine
,
leth
.
peers
,
leth
.
blockchain
,
nil
,
chainDb
,
leth
.
odr
,
leth
.
relay
,
quitSync
,
&
leth
.
wg
);
err
!=
nil
{
if
leth
.
protocolManager
,
err
=
NewProtocolManager
(
leth
.
chainConfig
,
true
,
ClientProtocolVersions
,
config
.
NetworkId
,
leth
.
eventMux
,
leth
.
engine
,
leth
.
peers
,
leth
.
blockchain
,
nil
,
chainDb
,
leth
.
odr
,
leth
.
relay
,
leth
.
serverPool
,
quitSync
,
&
leth
.
wg
);
err
!=
nil
{
return
nil
,
err
}
leth
.
ApiBackend
=
&
LesApiBackend
{
leth
,
nil
}
...
...
les/handler.go
View file @
546d4217
...
...
@@ -129,7 +129,7 @@ type ProtocolManager struct {
// NewProtocolManager returns a new ethereum sub protocol manager. The Ethereum sub protocol manages peers capable
// with the ethereum network.
func
NewProtocolManager
(
chainConfig
*
params
.
ChainConfig
,
lightSync
bool
,
protocolVersions
[]
uint
,
networkId
uint64
,
mux
*
event
.
TypeMux
,
engine
consensus
.
Engine
,
peers
*
peerSet
,
blockchain
BlockChain
,
txpool
txPool
,
chainDb
ethdb
.
Database
,
odr
*
LesOdr
,
txrelay
*
LesTxRelay
,
quitSync
chan
struct
{},
wg
*
sync
.
WaitGroup
)
(
*
ProtocolManager
,
error
)
{
func
NewProtocolManager
(
chainConfig
*
params
.
ChainConfig
,
lightSync
bool
,
protocolVersions
[]
uint
,
networkId
uint64
,
mux
*
event
.
TypeMux
,
engine
consensus
.
Engine
,
peers
*
peerSet
,
blockchain
BlockChain
,
txpool
txPool
,
chainDb
ethdb
.
Database
,
odr
*
LesOdr
,
txrelay
*
LesTxRelay
,
serverPool
*
serverPool
,
quitSync
chan
struct
{},
wg
*
sync
.
WaitGroup
)
(
*
ProtocolManager
,
error
)
{
// Create the protocol manager with the base fields
manager
:=
&
ProtocolManager
{
lightSync
:
lightSync
,
...
...
@@ -141,6 +141,7 @@ func NewProtocolManager(chainConfig *params.ChainConfig, lightSync bool, protoco
networkId
:
networkId
,
txpool
:
txpool
,
txrelay
:
txrelay
,
serverPool
:
serverPool
,
peers
:
peers
,
newPeerCh
:
make
(
chan
*
peer
),
quitSync
:
quitSync
,
...
...
les/helper_test.go
View file @
546d4217
...
...
@@ -178,7 +178,7 @@ func newTestProtocolManager(lightSync bool, blocks int, generator func(int, *cor
}
else
{
protocolVersions
=
ServerProtocolVersions
}
pm
,
err
:=
NewProtocolManager
(
gspec
.
Config
,
lightSync
,
protocolVersions
,
NetworkId
,
evmux
,
engine
,
peers
,
chain
,
nil
,
db
,
odr
,
nil
,
make
(
chan
struct
{}),
new
(
sync
.
WaitGroup
))
pm
,
err
:=
NewProtocolManager
(
gspec
.
Config
,
lightSync
,
protocolVersions
,
NetworkId
,
evmux
,
engine
,
peers
,
chain
,
nil
,
db
,
odr
,
nil
,
nil
,
make
(
chan
struct
{}),
new
(
sync
.
WaitGroup
))
if
err
!=
nil
{
return
nil
,
err
}
...
...
les/server.go
View file @
546d4217
...
...
@@ -52,7 +52,7 @@ type LesServer struct {
func
NewLesServer
(
eth
*
eth
.
Ethereum
,
config
*
eth
.
Config
)
(
*
LesServer
,
error
)
{
quitSync
:=
make
(
chan
struct
{})
pm
,
err
:=
NewProtocolManager
(
eth
.
BlockChain
()
.
Config
(),
false
,
ServerProtocolVersions
,
config
.
NetworkId
,
eth
.
EventMux
(),
eth
.
Engine
(),
newPeerSet
(),
eth
.
BlockChain
(),
eth
.
TxPool
(),
eth
.
ChainDb
(),
nil
,
nil
,
quitSync
,
new
(
sync
.
WaitGroup
))
pm
,
err
:=
NewProtocolManager
(
eth
.
BlockChain
()
.
Config
(),
false
,
ServerProtocolVersions
,
config
.
NetworkId
,
eth
.
EventMux
(),
eth
.
Engine
(),
newPeerSet
(),
eth
.
BlockChain
(),
eth
.
TxPool
(),
eth
.
ChainDb
(),
nil
,
nil
,
nil
,
quitSync
,
new
(
sync
.
WaitGroup
))
if
err
!=
nil
{
return
nil
,
err
}
...
...
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