mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-16 12:16:11 +00:00
fix small case
This commit is contained in:
@@ -854,6 +854,10 @@ func (m *PeerManager) Advertise(peerID types.NodeID, limit uint16) []NodeAddress
|
||||
addresses[i], addresses[j] = addresses[j], addresses[i]
|
||||
})
|
||||
|
||||
if len(addresses) <= int(limit) {
|
||||
return addresses
|
||||
}
|
||||
|
||||
return addresses[:limit-1]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user