hypercore 10.26.0 → 10.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -167,15 +167,16 @@ module.exports = class Hypercore extends EventEmitter {
|
|
|
167
167
|
if (!noiseStream.userData) {
|
|
168
168
|
const protocol = Protomux.from(noiseStream)
|
|
169
169
|
|
|
170
|
-
if (opts.ondiscoverykey) {
|
|
171
|
-
protocol.pair({ protocol: 'hypercore/alpha' }, opts.ondiscoverykey)
|
|
172
|
-
}
|
|
173
170
|
if (opts.keepAlive !== false) {
|
|
174
171
|
noiseStream.setKeepAlive(5000)
|
|
175
172
|
}
|
|
176
173
|
noiseStream.userData = protocol
|
|
177
174
|
}
|
|
178
175
|
|
|
176
|
+
if (opts.ondiscoverykey) {
|
|
177
|
+
noiseStream.userData.pair({ protocol: 'hypercore/alpha' }, opts.ondiscoverykey)
|
|
178
|
+
}
|
|
179
|
+
|
|
179
180
|
return outerStream
|
|
180
181
|
}
|
|
181
182
|
|