File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -1149,7 +1149,7 @@ class Peer {
11491149 this . _clearLocalRange ( fixedStart , length )
11501150 }
11511151
1152- onrange ( { drop, start, length } ) {
1152+ async onrange ( { drop, start, length } ) {
11531153 const has = drop === false
11541154
11551155 if ( drop === true && start < this . _remoteContiguousLength ) {
@@ -1159,7 +1159,15 @@ class Peer {
11591159 if ( start === 0 && drop === false ) {
11601160 if ( length > this . _remoteContiguousLength ) {
11611161 this . _remoteContiguousLength = length
1162- if ( this . remoteFork >= this . core . state . fork ) this . core . updateRemoteContiguousLength ( length )
1162+ if ( this . remoteFork >= this . core . state . fork ) {
1163+ try {
1164+ await this . core . updateRemoteContiguousLength ( length )
1165+ } catch ( err ) {
1166+ safetyCatch ( err )
1167+ this . paused = true
1168+ return
1169+ }
1170+ }
11631171 }
11641172 } else if ( length === 1 ) {
11651173 const bitfield = this . core . skipBitfield === null ? this . core . bitfield : this . core . skipBitfield
You can’t perform that action at this time.
0 commit comments