Skip to content

Commit

Permalink
unslab in PeerInfo constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
HDegroote committed Jul 30, 2024
1 parent f7e28b0 commit f6b22a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ module.exports = class Hyperswarm extends EventEmitter {
}

peerInfo = new PeerInfo({
publicKey: unslab(publicKey),
publicKey,
relayAddresses
})

Expand Down
3 changes: 2 additions & 1 deletion lib/peer-info.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { EventEmitter } = require('events')
const b4a = require('b4a')
const unslab = require('unslab')

const MIN_CONNECTION_TIME = 15000

Expand All @@ -13,7 +14,7 @@ module.exports = class PeerInfo extends EventEmitter {
constructor ({ publicKey, relayAddresses }) {
super()

this.publicKey = publicKey
this.publicKey = unslab(publicKey)
this.relayAddresses = relayAddresses

this.reconnecting = true
Expand Down

0 comments on commit f6b22a0

Please sign in to comment.