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
a2795c80
Unverified
Commit
a2795c80
authored
Dec 01, 2020
by
Felföldi Zsolt
Committed by
GitHub
Dec 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
les: fix nodiscover option (#21906)
parent
e7db1dbc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
9 deletions
+9
-9
flags.go
cmd/utils/flags.go
+3
-1
backend.go
eth/backend.go
+1
-1
discovery.go
eth/discovery.go
+2
-3
client.go
les/client.go
+1
-1
enr_entry.go
les/enr_entry.go
+2
-3
No files found.
cmd/utils/flags.go
View file @
a2795c80
...
...
@@ -1584,7 +1584,9 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
if
ctx
.
GlobalIsSet
(
RPCGlobalTxFeeCapFlag
.
Name
)
{
cfg
.
RPCTxFeeCap
=
ctx
.
GlobalFloat64
(
RPCGlobalTxFeeCapFlag
.
Name
)
}
if
ctx
.
GlobalIsSet
(
DNSDiscoveryFlag
.
Name
)
{
if
ctx
.
GlobalIsSet
(
NoDiscoverFlag
.
Name
)
{
cfg
.
DiscoveryURLs
=
[]
string
{}
}
else
if
ctx
.
GlobalIsSet
(
DNSDiscoveryFlag
.
Name
)
{
urls
:=
ctx
.
GlobalString
(
DNSDiscoveryFlag
.
Name
)
if
urls
==
""
{
cfg
.
DiscoveryURLs
=
[]
string
{}
...
...
eth/backend.go
View file @
a2795c80
...
...
@@ -208,7 +208,7 @@ func New(stack *node.Node, config *Config) (*Ethereum, error) {
}
eth
.
APIBackend
.
gpo
=
gasprice
.
NewOracle
(
eth
.
APIBackend
,
gpoParams
)
eth
.
dialCandidates
,
err
=
eth
.
setupDiscovery
(
&
stack
.
Config
()
.
P2P
)
eth
.
dialCandidates
,
err
=
eth
.
setupDiscovery
()
if
err
!=
nil
{
return
nil
,
err
}
...
...
eth/discovery.go
View file @
a2795c80
...
...
@@ -19,7 +19,6 @@ package eth
import
(
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/forkid"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/dnsdisc"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/rlp"
...
...
@@ -65,8 +64,8 @@ func (eth *Ethereum) currentEthEntry() *ethEntry {
}
// setupDiscovery creates the node discovery source for the eth protocol.
func
(
eth
*
Ethereum
)
setupDiscovery
(
cfg
*
p2p
.
Config
)
(
enode
.
Iterator
,
error
)
{
if
cfg
.
NoDiscovery
||
len
(
eth
.
config
.
DiscoveryURLs
)
==
0
{
func
(
eth
*
Ethereum
)
setupDiscovery
()
(
enode
.
Iterator
,
error
)
{
if
len
(
eth
.
config
.
DiscoveryURLs
)
==
0
{
return
nil
,
nil
}
client
:=
dnsdisc
.
NewClient
(
dnsdisc
.
Config
{})
...
...
les/client.go
View file @
a2795c80
...
...
@@ -112,7 +112,7 @@ func New(stack *node.Node, config *eth.Config) (*LightEthereum, error) {
}
peers
.
subscribe
((
*
vtSubscription
)(
leth
.
valueTracker
))
dnsdisc
,
err
:=
leth
.
setupDiscovery
(
&
stack
.
Config
()
.
P2P
)
dnsdisc
,
err
:=
leth
.
setupDiscovery
()
if
err
!=
nil
{
return
nil
,
err
}
...
...
les/enr_entry.go
View file @
a2795c80
...
...
@@ -17,7 +17,6 @@
package
les
import
(
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/dnsdisc"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/rlp"
...
...
@@ -35,8 +34,8 @@ func (e lesEntry) ENRKey() string {
}
// setupDiscovery creates the node discovery source for the eth protocol.
func
(
eth
*
LightEthereum
)
setupDiscovery
(
cfg
*
p2p
.
Config
)
(
enode
.
Iterator
,
error
)
{
if
cfg
.
NoDiscovery
||
len
(
eth
.
config
.
DiscoveryURLs
)
==
0
{
func
(
eth
*
LightEthereum
)
setupDiscovery
()
(
enode
.
Iterator
,
error
)
{
if
len
(
eth
.
config
.
DiscoveryURLs
)
==
0
{
return
nil
,
nil
}
client
:=
dnsdisc
.
NewClient
(
dnsdisc
.
Config
{})
...
...
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