Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
iurii-ssv committed Dec 2, 2024
1 parent 9eae952 commit 8ee34ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions network/p2p/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,11 @@ func (n *p2pNetwork) PeerProtection(allPeers []peer.ID, mySubnets records.Subnet
subnetPeers := n.idx.GetSubnetPeers(subnet)
slices.SortFunc(subnetPeers, func(a, b peer.ID) int {
// take the peers with the most shared subnets
aShares := len(records.SharedSubnets(n.activeSubnets, n.idx.GetPeerSubnets(a), 0))
aShared := len(records.SharedSubnets(n.activeSubnets, n.idx.GetPeerSubnets(a), 0))
bShared := len(records.SharedSubnets(n.activeSubnets, n.idx.GetPeerSubnets(b), 0))
if aShares < bShared {
if aShared < bShared {
return 1
} else if aShares > bShared {
} else if aShared > bShared {
return -1
} else {
return 0
Expand Down

0 comments on commit 8ee34ca

Please sign in to comment.