4
4
using System ;
5
5
using System . Collections . Concurrent ;
6
6
using System . Collections . Generic ;
7
+ using System . Linq ;
7
8
using System . Numerics ;
8
9
using System . Text . RegularExpressions ;
9
10
using Nethermind . Config ;
@@ -35,6 +36,14 @@ namespace Nethermind.Network
35
36
{
36
37
public class ProtocolsManager : IProtocolsManager
37
38
{
39
+ public static readonly IEnumerable < Capability > DefaultCapabilities = new Capability [ ]
40
+ {
41
+ new ( Protocol . Eth , 66 ) ,
42
+ new ( Protocol . Eth , 67 ) ,
43
+ new ( Protocol . Eth , 68 ) ,
44
+ new ( Protocol . NodeData , 1 )
45
+ } ;
46
+
38
47
private readonly ConcurrentDictionary < Guid , SyncPeerProtocolHandlerBase > _syncPeers = new ( ) ;
39
48
40
49
private readonly ConcurrentDictionary < Node , ConcurrentDictionary < Guid , ProtocolHandlerBase > > _hangingSatelliteProtocols =
@@ -54,11 +63,10 @@ public class ProtocolsManager : IProtocolsManager
54
63
private readonly ForkInfo _forkInfo ;
55
64
private readonly IGossipPolicy _gossipPolicy ;
56
65
private readonly ITxGossipPolicy _txGossipPolicy ;
57
- private readonly INetworkConfig _networkConfig ;
58
66
private readonly ILogManager _logManager ;
59
67
private readonly ILogger _logger ;
60
68
private readonly IDictionary < string , Func < ISession , int , IProtocolHandler > > _protocolFactories ;
61
- private readonly HashSet < Capability > _capabilities = new ( ) ;
69
+ private readonly HashSet < Capability > _capabilities = DefaultCapabilities . ToHashSet ( ) ;
62
70
private readonly Regex ? _clientIdPattern ;
63
71
private readonly IBackgroundTaskScheduler _backgroundTaskScheduler ;
64
72
private readonly ISnapServer ? _snapServer ;
@@ -98,7 +106,6 @@ public ProtocolsManager(
98
106
_gossipPolicy = gossipPolicy ?? throw new ArgumentNullException ( nameof ( gossipPolicy ) ) ;
99
107
_txGossipPolicy = transactionsGossipPolicy ?? ShouldGossip . Instance ;
100
108
_logManager = logManager ?? throw new ArgumentNullException ( nameof ( logManager ) ) ;
101
- _networkConfig = networkConfig ?? throw new ArgumentNullException ( nameof ( networkConfig ) ) ;
102
109
_snapServer = snapServer ;
103
110
_logger = _logManager ? . GetClassLogger ( ) ?? throw new ArgumentNullException ( nameof ( logManager ) ) ;
104
111
0 commit comments