diff --git a/node/nodeRunner.go b/node/nodeRunner.go index 5387e5f774a..30ff5547ac6 100644 --- a/node/nodeRunner.go +++ b/node/nodeRunner.go @@ -1223,11 +1223,6 @@ func (nr *nodeRunner) CreateManagedBootstrapComponents( func (nr *nodeRunner) CreateManagedNetworkComponents( coreComponents mainFactory.CoreComponentsHolder, ) (mainFactory.NetworkComponentsHandler, error) { - decodedPreferredPeers, err := decodePreferredPeers(*nr.configs.PreferencesConfig, coreComponents.ValidatorPubKeyConverter()) - if err != nil { - return nil, err - } - networkComponentsFactoryArgs := mainFactory.NetworkComponentsFactoryArgs{ P2pConfig: *nr.configs.P2pConfig, MainConfig: *nr.configs.GeneralConfig, @@ -1235,7 +1230,7 @@ func (nr *nodeRunner) CreateManagedNetworkComponents( StatusHandler: coreComponents.StatusHandler(), Marshalizer: coreComponents.InternalMarshalizer(), Syncer: coreComponents.SyncTimer(), - PreferredPeersSlices: decodedPreferredPeers, + PreferredPeersSlices: nr.configs.PreferencesConfig.Preferences.PreferredConnections, BootstrapWaitTime: common.TimeToWaitForP2PBootstrap, NodeOperationMode: p2p.NormalOperation, ConnectionWatcherType: nr.configs.PreferencesConfig.Preferences.ConnectionWatcherType, @@ -1503,20 +1498,6 @@ func enableGopsIfNeeded(gopsEnabled bool) { log.Trace("gops", "enabled", gopsEnabled) } -func decodePreferredPeers(prefConfig config.Preferences, validatorPubKeyConverter core.PubkeyConverter) ([]string, error) { - decodedPeers := make([]string, 0) - for _, connectionSlice := range prefConfig.Preferences.PreferredConnections { - peerBytes, err := validatorPubKeyConverter.Decode(connectionSlice) - if err != nil { - return nil, fmt.Errorf("cannot decode preferred peer(%s) : %w", connectionSlice, err) - } - - decodedPeers = append(decodedPeers, string(peerBytes)) - } - - return decodedPeers, nil -} - func createWhiteListerVerifiedTxs(generalConfig *config.Config) (process.WhiteListHandler, error) { whiteListCacheVerified, err := storageUnit.NewCache(storageFactory.GetCacherFromConfig(generalConfig.WhiteListerVerifiedTxs)) if err != nil {