diff --git a/lib/replicator.js b/lib/replicator.js index 55fd4db6..96be4b56 100644 --- a/lib/replicator.js +++ b/lib/replicator.js @@ -525,8 +525,6 @@ class Peer { } onopen ({ seeks, capability }) { - if (this.replicator.destroyed) return - const expected = caps.replicate(this.stream.isInitiator === false, this.replicator.key, this.stream.handshakeHash) if (b4a.equals(capability, expected) !== true) { // TODO: change this to a rejection instead, less leakage @@ -607,8 +605,6 @@ class Peer { } async onsync ({ fork, length, remoteLength, canUpgrade, uploading, downloading, hasManifest }) { - if (this.replicator.destroyed) return - const lengthChanged = length !== this.remoteLength const sameFork = fork === this.core.tree.fork @@ -673,8 +669,6 @@ class Peer { // Safe to call in the background - never fails async _canUpgrade (remoteLength, remoteFork) { - if (this.replicator.destroyed) return false - if (remoteFork !== this.core.tree.fork) return false if (remoteLength === 0) return true @@ -714,8 +708,6 @@ class Peer { async onrequest (msg) { this.tracer.trace('onrequest', msg) - if (this.replicator.destroyed) return - const size = this.remoteRequests.size this.remoteRequests.set(msg.id, msg) @@ -856,8 +848,6 @@ class Peer { async ondata (data) { this.tracer.trace('ondata', data) - if (this.replicator.destroyed) return - // always allow a fork conflict proof to be sent if (data.request === 0 && data.upgrade && data.upgrade.start === 0) { if (await this.core.checkConflict(data, this)) return