File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -29,20 +29,20 @@ export class BaseProtocolSDK implements IBaseProtocolSDK {
29
29
) {
30
30
this . log = new Logger ( `sdk:${ core . multicodec } ` ) ;
31
31
32
- this . peerManager = new PeerManager ( connectionManager , core , this . log ) ;
33
-
34
32
this . numPeersToUse = options ?. numPeersToUse ?? DEFAULT_NUM_PEERS_TO_USE ;
35
33
const maintainPeersInterval =
36
34
options ?. maintainPeersInterval ?? DEFAULT_MAINTAIN_PEERS_INTERVAL ;
37
35
36
+ this . peerManager = new PeerManager ( connectionManager , core , this . log ) ;
37
+
38
38
this . log . info (
39
39
`Initializing BaseProtocolSDK with numPeersToUse: ${ this . numPeersToUse } , maintainPeersInterval: ${ maintainPeersInterval } ms`
40
40
) ;
41
41
void this . startMaintainPeersInterval ( maintainPeersInterval ) ;
42
42
}
43
43
44
44
public get connectedPeers ( ) : Peer [ ] {
45
- return this . peerManager . getPeers ( ) ;
45
+ return this . peerManager . getPeers ( ) . slice ( 0 , this . numPeersToUse ) ;
46
46
}
47
47
48
48
/**
Original file line number Diff line number Diff line change @@ -72,7 +72,7 @@ export class WakuNode implements IWaku {
72
72
73
73
public constructor (
74
74
public readonly pubsubTopics : PubsubTopic [ ] ,
75
- options : WakuOptions ,
75
+ options : CreateWakuNodeOptions ,
76
76
libp2p : Libp2p ,
77
77
protocolsEnabled : ProtocolsEnabled ,
78
78
relay ?: IRelay
@@ -111,12 +111,12 @@ export class WakuNode implements IWaku {
111
111
}
112
112
113
113
if ( protocolsEnabled . lightpush ) {
114
- const lightPush = wakuLightPush ( this . connectionManager ) ;
114
+ const lightPush = wakuLightPush ( this . connectionManager , options ) ;
115
115
this . lightPush = lightPush ( libp2p ) ;
116
116
}
117
117
118
118
if ( protocolsEnabled . filter ) {
119
- const filter = wakuFilter ( this . connectionManager ) ;
119
+ const filter = wakuFilter ( this . connectionManager , options ) ;
120
120
this . filter = filter ( libp2p ) ;
121
121
}
122
122
You can’t perform that action at this time.
0 commit comments