No need to lock here since Topology read locks and makes copies
This commit is contained in:
parent
63fd8b9d1b
commit
5c38f38dd9
@ -170,9 +170,6 @@ func (n *node) Nodes() []Node {
|
|||||||
// GetPeerNode returns a node from node MaxDepth topology
|
// GetPeerNode returns a node from node MaxDepth topology
|
||||||
// It returns nil if the peer was not found
|
// It returns nil if the peer was not found
|
||||||
func (n *node) GetPeerNode(id string) *node {
|
func (n *node) GetPeerNode(id string) *node {
|
||||||
n.RLock()
|
|
||||||
defer n.RUnlock()
|
|
||||||
|
|
||||||
// get node topology up to MaxDepth
|
// get node topology up to MaxDepth
|
||||||
top := n.Topology(MaxDepth)
|
top := n.Topology(MaxDepth)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user