aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/simulations/http.go
diff options
context:
space:
mode:
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)