Skip to content

Commit

Permalink
revert previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
chm-diederichs committed Sep 27, 2024
1 parent 1f1aef8 commit f9e95b1
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions lib/replicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f9e95b1

Please sign in to comment.