File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -308,7 +308,6 @@ class Peer {
308308
309309 this . remoteFork = 0
310310 this . remoteLength = 0
311- this . remoteContiguousLength = 0
312311 this . remoteCanUpgrade = false
313312 this . remoteUploading = true
314313 this . remoteDownloading = true
@@ -326,6 +325,10 @@ class Peer {
326325 replicator . _ifAvailable ++
327326 }
328327
328+ get remoteContiguousLength ( ) {
329+ return this . remoteBitfield . findFirst ( false , 0 )
330+ }
331+
329332 getMaxInflight ( ) {
330333 const stream = this . stream . rawStream
331334 if ( ! stream . udx ) return Math . min ( this . inflightRange [ 1 ] , this . inflightRange [ 0 ] * 3 )
@@ -680,9 +683,6 @@ class Peer {
680683 }
681684
682685 onrange ( { drop, start, length } ) {
683- if ( start === 0 ) this . remoteContiguousLength = length
684- if ( drop ) this . remoteContiguousLength = Math . min ( this . remoteContiguousLength , start )
685-
686686 const has = drop === false
687687 const rangeStart = this . remoteBitfield . findFirst ( ! has , start )
688688 const rangeLength = length - ( rangeStart - start )
You can’t perform that action at this time.
0 commit comments