diff --git a/src/Nethermind/Nethermind.Init/Steps/InitializeNetwork.cs b/src/Nethermind/Nethermind.Init/Steps/InitializeNetwork.cs index faa3742db87..e17a9d2bb9b 100644 --- a/src/Nethermind/Nethermind.Init/Steps/InitializeNetwork.cs +++ b/src/Nethermind/Nethermind.Init/Steps/InitializeNetwork.cs @@ -201,19 +201,11 @@ await InitPeer().ContinueWith(initPeerTask => } }); - if (_syncConfig.SnapSync) + if (_syncConfig.SnapSync && !_syncConfig.SnapServingEnabled) { - if (!_syncConfig.SnapServingEnabled) - { - // TODO: Should we keep snap capability even after finishing sync? - SnapCapabilitySwitcher snapCapabilitySwitcher = - new(_api.ProtocolsManager, _api.SyncModeSelector, _api.LogManager); - snapCapabilitySwitcher.EnableSnapCapabilityUntilSynced(); - } - else - { - _api.ProtocolsManager!.AddSupportedCapability(new Capability(Protocol.Snap, 1)); - } + SnapCapabilitySwitcher snapCapabilitySwitcher = + new(_api.ProtocolsManager, _api.SyncModeSelector, _api.LogManager); + snapCapabilitySwitcher.EnableSnapCapabilityUntilSynced(); } else if (_logger.IsDebug) _logger.Debug("Skipped enabling snap capability"); @@ -536,6 +528,11 @@ private async Task InitPeer() _api.LogManager, _api.TxGossipPolicy); + if (_syncConfig.SnapServingEnabled) + { + _api.ProtocolsManager!.AddSupportedCapability(new Capability(Protocol.Snap, 1)); + } + if (_syncConfig.WitnessProtocolEnabled) { _api.ProtocolsManager.AddSupportedCapability(new Capability(Protocol.Wit, 0));