Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hyperswarm

Package Overview
Dependencies
Maintainers
4
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyperswarm - npm Package Compare versions

Comparing version 4.7.1 to 4.7.2

8

index.js

@@ -20,2 +20,4 @@ const { EventEmitter } = require('events')

const KEEP_ALIVE = b4a.alloc(0)
module.exports = class Hyperswarm extends EventEmitter {

@@ -274,6 +276,8 @@ constructor (opts = {}) {

if (existing) {
// if both connections are from the same peer, pick newest. otherwise tie break based on pub keys
const keepNew = conn.isInitiator === existing.isInitiator || b4a.compare(conn.publicKey, conn.remotePublicKey) > 0
const expectedInitiator = b4a.compare(conn.publicKey, conn.remotePublicKey) > 0
// if both connections are from the same peer, pick the one thats expected to initiate in a tie break
const keepNew = expectedInitiator === conn.isInitiator
if (keepNew === false) {
existing.write(KEEP_ALIVE) // check to see if its still alive actually
conn.on('error', noop)

@@ -280,0 +284,0 @@ conn.destroy(new Error(ERR_DUPLICATE))

{
"name": "hyperswarm",
"version": "4.7.1",
"version": "4.7.2",
"description": "A distributed networking stack for connecting peers",

@@ -5,0 +5,0 @@ "files": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc