Skip to content

Commit

Permalink
Remove trackedSubnet check for explicitly named peers in network.Send…
Browse files Browse the repository at this point in the history
…() (#3258)

Signed-off-by: Ian Suvak <ian.suvak@avalabs.org>
Co-authored-by: Dhruba Basu <7675102+dhrubabasu@users.noreply.github.com>
  • Loading branch information
iansuvak and dhrubabasu authored Aug 2, 2024
1 parent 9574f76 commit 5282943
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -678,10 +678,10 @@ func (n *network) track(ip *ips.ClaimedIPPort) error {
//
// - [nodeIDs] the IDs of the peers that should be returned if they are
// connected.
// - [subnetID] the subnetID whose membership should be considered if
// [validatorOnly] is set to true.
// - [validatorOnly] is the flag to drop any nodes from [nodeIDs] that are not
// validators in [subnetID].
// - [subnetID] the subnetID whose membership should be considered to
// determine if the node is a validator.
// - [allower] interface that determines if a node is allowed to connect to
// the subnet based on its validator status.
func (n *network) getPeers(
nodeIDs set.Set[ids.NodeID],
subnetID ids.ID,
Expand All @@ -698,10 +698,6 @@ func (n *network) getPeers(
continue
}

if trackedSubnets := peer.TrackedSubnets(); !trackedSubnets.Contains(subnetID) {
continue
}

_, isValidator := n.config.Validators.GetValidator(subnetID, nodeID)
// check if the peer is allowed to connect to the subnet
if !allower.IsAllowed(nodeID, isValidator) {
Expand Down

0 comments on commit 5282943

Please sign in to comment.