swarm/network: use Hive.Peer in Hive.PeerInfo function

This commit is contained in:
Janos Guljas 2019-04-15 14:31:13 +02:00
parent c0b78b0db6
commit 22ca0b5c82

View file

@ -192,9 +192,7 @@ func (h *Hive) NodeInfo() interface{} {
// PeerInfo function is used by the p2p.server RPC interface to display
// protocol specific information any connected peer referred to by their NodeID
func (h *Hive) PeerInfo(id enode.ID) interface{} {
h.lock.Lock()
p := h.peers[id]
h.lock.Unlock()
p := h.Peer(id)
if p == nil {
return nil