@@ -268,15 +268,15 @@ class BlockTracker {
268
268
}
269
269
270
270
class Peer {
271
- constructor ( replicator , protomux , channel , session , opts = { } ) {
271
+ constructor ( replicator , protomux , channel , session , inflightRange ) {
272
272
this . tracer = createTracer ( this , { parent : replicator . core . tracer } )
273
273
this . core = replicator . core
274
274
this . replicator = replicator
275
275
this . stream = protomux . stream
276
276
this . protomux = protomux
277
277
this . remotePublicKey = this . stream . remotePublicKey
278
278
this . remoteSupportsSeeks = false
279
- this . inflightRange = opts . inflightRange || DEFAULT_MAX_INFLIGHT
279
+ this . inflightRange = inflightRange
280
280
281
281
this . paused = false
282
282
@@ -1242,7 +1242,7 @@ module.exports = class Replicator {
1242
1242
this . downloading = false
1243
1243
this . activeSessions = 0
1244
1244
1245
- this . inflightRange = inflightRange
1245
+ this . inflightRange = inflightRange || DEFAULT_MAX_INFLIGHT
1246
1246
1247
1247
this . _attached = new Set ( )
1248
1248
this . _inflight = new InflightTracker ( )
@@ -2093,8 +2093,7 @@ module.exports = class Replicator {
2093
2093
2094
2094
if ( channel === null ) return onnochannel ( )
2095
2095
2096
- const opts = { inflightRange : this . inflightRange }
2097
- const peer = new Peer ( replicator , protomux , channel , session , opts )
2096
+ const peer = new Peer ( replicator , protomux , channel , session , this . inflightRange )
2098
2097
const stream = protomux . stream
2099
2098
2100
2099
peer . channel . open ( {
0 commit comments