Skip to content

Commit 72f37ac

Browse files
committedMay 28, 2020
fix: always emit when a connection is made
1 parent 52a615f commit 72f37ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/connection-manager/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,11 @@ class ConnectionManager extends EventEmitter {
175175
const peerIdStr = peerId.toB58String()
176176
const storedConn = this.connections.get(peerIdStr)
177177

178+
this.emit('peer:connect', connection)
178179
if (storedConn) {
179180
storedConn.push(connection)
180181
} else {
181182
this.connections.set(peerIdStr, [connection])
182-
this.emit('peer:connect', connection)
183183
}
184184

185185
this._libp2p.peerStore.keyBook.set(peerId, peerId.pubKey)

0 commit comments

Comments
 (0)
Please sign in to comment.