fix small case

(cherry picked from commit 56a91642dc)
This commit is contained in:
tycho garen
2022-06-10 07:54:02 -04:00
parent dfcd59c367
commit 6833ca805d

View File

@@ -877,6 +877,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]
}