Commit fd0f3d7c authored by suyanlong's avatar suyanlong

Fix RandRouterPort function

parent a00052d2
Pipeline #8421 failed with stages
......@@ -133,6 +133,7 @@ func (p *PortMap) RandRouterPort() Port {
p.rw.RLock()
defer p.rw.RUnlock()
l := len(p.peerPort)
if l > 0 {
i := rand.Intn(l)
j := 0
for _, pt := range p.peerPort {
......@@ -141,6 +142,7 @@ func (p *PortMap) RandRouterPort() Port {
}
j++
}
}
return nil
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment