diff options
author | Janos Guljas <janos@resenje.org> | 2018-09-25 22:57:31 +0800 |
---|---|---|
committer | Janos Guljas <janos@resenje.org> | 2018-09-25 22:57:31 +0800 |
commit | 24349144b6c0642755569268bab56b9033743212 (patch) | |
tree | 9d9d2b6659fd8a56512dfc807aafe4b733165ae1 /node | |
parent | 7d56602391e155e2ce9ba7c261300a1804ab9972 (diff) | |
parent | d3441ebb563439bac0837d70591f92e2c6080303 (diff) | |
download | dexon-24349144b6c0642755569268bab56b9033743212.tar dexon-24349144b6c0642755569268bab56b9033743212.tar.gz dexon-24349144b6c0642755569268bab56b9033743212.tar.bz2 dexon-24349144b6c0642755569268bab56b9033743212.tar.lz dexon-24349144b6c0642755569268bab56b9033743212.tar.xz dexon-24349144b6c0642755569268bab56b9033743212.tar.zst dexon-24349144b6c0642755569268bab56b9033743212.zip |
Merge branch 'master' into max-stream-peer-servers
Diffstat (limited to 'node')
-rw-r--r-- | node/api.go | 10 | ||||
-rw-r--r-- | node/config.go | 12 |
2 files changed, 11 insertions, 11 deletions
diff --git a/node/api.go b/node/api.go index 2656c2120..6e36e505d 100644 --- a/node/api.go +++ b/node/api.go @@ -26,7 +26,7 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/discover" + "github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/rpc" ) @@ -51,7 +51,7 @@ func (api *PrivateAdminAPI) AddPeer(url string) (bool, error) { return false, ErrNodeStopped } // Try to add the url as a static peer and return - node, err := discover.ParseNode(url) + node, err := enode.ParseV4(url) if err != nil { return false, fmt.Errorf("invalid enode: %v", err) } @@ -67,7 +67,7 @@ func (api *PrivateAdminAPI) RemovePeer(url string) (bool, error) { return false, ErrNodeStopped } // Try to remove the url as a static peer and return - node, err := discover.ParseNode(url) + node, err := enode.ParseV4(url) if err != nil { return false, fmt.Errorf("invalid enode: %v", err) } @@ -82,7 +82,7 @@ func (api *PrivateAdminAPI) AddTrustedPeer(url string) (bool, error) { if server == nil { return false, ErrNodeStopped } - node, err := discover.ParseNode(url) + node, err := enode.ParseV4(url) if err != nil { return false, fmt.Errorf("invalid enode: %v", err) } @@ -98,7 +98,7 @@ func (api *PrivateAdminAPI) RemoveTrustedPeer(url string) (bool, error) { if server == nil { return false, ErrNodeStopped } - node, err := discover.ParseNode(url) + node, err := enode.ParseV4(url) if err != nil { return false, fmt.Errorf("invalid enode: %v", err) } diff --git a/node/config.go b/node/config.go index a4d5920a8..8f10f4f61 100644 --- a/node/config.go +++ b/node/config.go @@ -32,7 +32,7 @@ import ( "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/p2p" - "github.com/ethereum/go-ethereum/p2p/discover" + "github.com/ethereum/go-ethereum/p2p/enode" "github.com/ethereum/go-ethereum/rpc" ) @@ -336,18 +336,18 @@ func (c *Config) NodeKey() *ecdsa.PrivateKey { } // StaticNodes returns a list of node enode URLs configured as static nodes. -func (c *Config) StaticNodes() []*discover.Node { +func (c *Config) StaticNodes() []*enode.Node { return c.parsePersistentNodes(c.ResolvePath(datadirStaticNodes)) } // TrustedNodes returns a list of node enode URLs configured as trusted nodes. -func (c *Config) TrustedNodes() []*discover.Node { +func (c *Config) TrustedNodes() []*enode.Node { return c.parsePersistentNodes(c.ResolvePath(datadirTrustedNodes)) } // parsePersistentNodes parses a list of discovery node URLs loaded from a .json // file from within the data directory. -func (c *Config) parsePersistentNodes(path string) []*discover.Node { +func (c *Config) parsePersistentNodes(path string) []*enode.Node { // Short circuit if no node config is present if c.DataDir == "" { return nil @@ -362,12 +362,12 @@ func (c *Config) parsePersistentNodes(path string) []*discover.Node { return nil } // Interpret the list as a discovery node array - var nodes []*discover.Node + var nodes []*enode.Node for _, url := range nodelist { if url == "" { continue } - node, err := discover.ParseNode(url) + node, err := enode.ParseV4(url) if err != nil { log.Error(fmt.Sprintf("Node URL %s: %v\n", url, err)) continue |