aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/simulations/http.go
diff options
context:
space:
mode:
authorJanos Guljas <janos@resenje.org>2018-09-25 22:57:31 +0800
committerJanos Guljas <janos@resenje.org>2018-09-25 22:57:31 +0800
commit24349144b6c0642755569268bab56b9033743212 (patch)
tree9d9d2b6659fd8a56512dfc807aafe4b733165ae1 /p2p/simulations/http.go
parent7d56602391e155e2ce9ba7c261300a1804ab9972 (diff)
parentd3441ebb563439bac0837d70591f92e2c6080303 (diff)
downloadgo-tangerine-24349144b6c0642755569268bab56b9033743212.tar
go-tangerine-24349144b6c0642755569268bab56b9033743212.tar.gz
go-tangerine-24349144b6c0642755569268bab56b9033743212.tar.bz2
go-tangerine-24349144b6c0642755569268bab56b9033743212.tar.lz
go-tangerine-24349144b6c0642755569268bab56b9033743212.tar.xz
go-tangerine-24349144b6c0642755569268bab56b9033743212.tar.zst
go-tangerine-24349144b6c0642755569268bab56b9033743212.zip
Merge branch 'master' into max-stream-peer-servers
Diffstat (limited to 'p2p/simulations/http.go')
-rw-r--r--p2p/simulations/http.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/p2p/simulations/http.go b/p2p/simulations/http.go
index 24001f194..1f44cc667 100644
--- a/p2p/simulations/http.go
+++ b/p2p/simulations/http.go
@@ -31,7 +31,7 @@ import (
"github.com/ethereum/go-ethereum/event"
"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/p2p/simulations/adapters"
"github.com/ethereum/go-ethereum/rpc"
"github.com/julienschmidt/httprouter"
@@ -709,8 +709,9 @@ func (s *Server) wrapHandler(handler http.HandlerFunc) httprouter.Handle {
ctx := context.Background()
if id := params.ByName("nodeid"); id != "" {
+ var nodeID enode.ID
var node *Node
- if nodeID, err := discover.HexID(id); err == nil {
+ if nodeID.UnmarshalText([]byte(id)) == nil {
node = s.network.GetNode(nodeID)
} else {
node = s.network.GetNodeByName(id)
@@ -723,8 +724,9 @@ func (s *Server) wrapHandler(handler http.HandlerFunc) httprouter.Handle {
}
if id := params.ByName("peerid"); id != "" {
+ var peerID enode.ID
var peer *Node
- if peerID, err := discover.HexID(id); err == nil {
+ if peerID.UnmarshalText([]byte(id)) == nil {
peer = s.network.GetNode(peerID)
} else {
peer = s.network.GetNodeByName(id)