hypercore
Advanced tools
Comparing version 1.5.8 to 1.6.0
@@ -30,2 +30,3 @@ var subleveldown = require('subleveldown') | ||
this.swarm = swarm(this, opts) | ||
this.peers = [] | ||
} | ||
@@ -32,0 +33,0 @@ |
@@ -204,2 +204,6 @@ var protocol = require('./protocol') | ||
peer.on('close', remove) | ||
peer.on('handshake', function () { | ||
self.core.peers.push(peer) | ||
self.core.emit('peer', peer) | ||
}) | ||
@@ -279,3 +283,5 @@ this.peers.push(peer) | ||
if (i > -1) self.peers.splice(i, 1) | ||
i = self.core.peers.indexOf(peer) | ||
if (i > -1) self.core.peers.splice(i, 1) | ||
} | ||
} |
{ | ||
"name": "hypercore", | ||
"version": "1.5.8", | ||
"version": "1.6.0", | ||
"description": "Hypercore is a protocol and network for distributing and replicating static feeds of binary data.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -22,2 +22,14 @@ var tape = require('tape') | ||
tape('emits peer', function (t) { | ||
var core = create() | ||
var remote = create() | ||
core.once('peer', function (peer) { | ||
t.ok(peer.remoteId) | ||
t.end() | ||
}) | ||
replicate(core, remote) | ||
}) | ||
tape('replicate and get block', function (t) { | ||
@@ -24,0 +36,0 @@ var core = create() |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
59424
1597