From 9740cfd43ec0930616631a807e4cd4741bce4f6f Mon Sep 17 00:00:00 2001 From: Jacky Wang Date: Fri, 14 Aug 2020 14:38:20 -0700 Subject: [PATCH] [cmd] fix localnet syncing provider --- cmd/harmony/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/harmony/main.go b/cmd/harmony/main.go index 1cd6affc4..1728d5035 100644 --- a/cmd/harmony/main.go +++ b/cmd/harmony/main.go @@ -553,16 +553,16 @@ func setupConsensusAndNode(hc harmonyConfig, nodeConfig *nodeconfig.ConfigType) } if hc.Network.LegacySyncing { - currentNode.SyncingPeerProvider = node.NewLegacySyncingPeerProvider(currentNode) - } else { if hc.Network.NetworkType == nodeconfig.Localnet { epochConfig := shard.Schedule.InstanceForEpoch(ethCommon.Big0) selfPort := hc.P2P.Port currentNode.SyncingPeerProvider = node.NewLocalSyncingPeerProvider( 6000, uint16(selfPort), epochConfig.NumShards(), uint32(epochConfig.NumNodesPerShard())) } else { - currentNode.SyncingPeerProvider = node.NewDNSSyncingPeerProvider(hc.Network.DNSZone, syncing.GetSyncingPort(strconv.Itoa(hc.Network.DNSPort))) + currentNode.SyncingPeerProvider = node.NewLegacySyncingPeerProvider(currentNode) } + } else { + currentNode.SyncingPeerProvider = node.NewDNSSyncingPeerProvider(hc.Network.DNSZone, syncing.GetSyncingPort(strconv.Itoa(hc.Network.DNSPort))) } // TODO: refactor the creation of blockchain out of node.New()