@@ -671,16 +671,17 @@ func (n *Network) CreateSubnets(ctx context.Context, log logging.Logger, apiNode
671671 }
672672
673673 // Track the set of nodes that will need to be restarted after subnet creation
674- nodesToRestart := set.Set [ids.NodeID ]{}
674+ reconfiguredNodes := set.Set [ids.NodeID ]{}
675675
676676 // Update node configuration to track the new subnets
677677 for _ , node := range n .Nodes {
678678 existingTrackedSubnets := node .Flags [config .TrackSubnetsKey ]
679679 trackedSubnets := n .TrackedSubnetsForNode (node .NodeID )
680- if existingTrackedSubnets != trackedSubnets {
681- node .Flags [config .TrackSubnetsKey ] = trackedSubnets
682- nodesToRestart .Add (node .NodeID )
680+ if existingTrackedSubnets == trackedSubnets {
681+ continue
683682 }
683+ node .Flags [config .TrackSubnetsKey ] = trackedSubnets
684+ reconfiguredNodes .Add (node .NodeID )
684685 }
685686
686687 // Add validators for the subnet
@@ -729,11 +730,11 @@ func (n *Network) CreateSubnets(ctx context.Context, log logging.Logger, apiNode
729730 // subnet's validator nodes will need to be restarted for those nodes to read
730731 // the newly written chain configuration and apply it to the chain(s).
731732 if subnet .HasChainConfig () {
732- nodesToRestart .Add (subnet .ValidatorIDs ... )
733+ reconfiguredNodes .Add (subnet .ValidatorIDs ... )
733734 }
734735 }
735736
736- return nodesToRestart , nil
737+ return reconfiguredNodes , nil
737738}
738739
739740func (n * Network ) GetNode (nodeID ids.NodeID ) (* Node , error ) {
0 commit comments