libp2p 0.36.1 → 0.36.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/index.js"],"names":[],"mappings":";AAsCA;;;GAGG;AAEH;;;;;;;;;;;;;GAaG;AAEH;;;;GAIG;AACH;IACE;;;;;;OAMG;IACH,oBAHW,MAAM,YACN,wBAAwB,EAgDlC;IA3CC,uBAAqB;IACrB,gBAA0C;IAE1C,cAAqF;IAOrF;;;;OAIG;IACH,aAFU,IAAI,MAAM,EAAE,MAAM,CAAC,CAM3B;IAEF;;;;OAIG;IACH,aAFU,IAAI,MAAM,EAAE,UAAU,EAAE,CAAC,CAMjC;IAEF,kBAAqB;IACrB,YAAkB;IAuFpB;;;;;OAKG;IACH,sBAiBC;IA3GC,gCAGE;IAMJ;;OAEG;IACH,mBAGC;IAED;;;OAGG;IACH,cAYC;IAgKD;;;;;OAKG;IACH,0BAKC;IAzKD;;;;OAIG;IACH,sBASC;IAED;;;;OAIG;IACH,wBAWC;IAED;;;;;;;OAOG;IACH,qBAJW,MAAM,SACN,MAAM,GACJ,IAAI,CAOhB;IA2BD;;;;OAIG;IACH,sBAFW,UAAU,iBAsBpB;IAED;;;;;OAKG;IACH,yBAHW,UAAU,GACR,IAAI,CAgBhB;IAED;;;;;OAKG;IACH,YAHW,MAAM,GACJ,UAAU,GAAC,IAAI,CAQ3B;IAED;;;;;OAKG;IACH,eAHW,MAAM,GACJ,UAAU,EAAE,CAexB;IAeD;;;;;;OAMG;IACH,uBAOC;IAED;;;;;OAKG;IACH,4BAqBC;CACF;;;;;;;;cAjUY,OAAO,KAAK,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connection-manager/index.js"],"names":[],"mappings":";AAsCA;;;GAGG;AAEH;;;;;;;;;;;;;GAaG;AAEH;;;;GAIG;AACH;IACE;;;;;;OAMG;IACH,oBAHW,MAAM,YACN,wBAAwB,EAgDlC;IA3CC,uBAAqB;IACrB,gBAA0C;IAE1C,cAAqF;IAOrF;;;;OAIG;IACH,aAFU,IAAI,MAAM,EAAE,MAAM,CAAC,CAM3B;IAEF;;;;OAIG;IACH,aAFU,IAAI,MAAM,EAAE,UAAU,EAAE,CAAC,CAMjC;IAEF,kBAAqB;IACrB,YAAkB;IAuFpB;;;;;OAKG;IACH,sBAiBC;IA3GC,gCAGE;IAMJ;;OAEG;IACH,mBAGC;IAED;;;OAGG;IACH,cAYC;IA2KD;;;;;OAKG;IACH,0BAKC;IApLD;;;;OAIG;IACH,sBASC;IAED;;;;OAIG;IACH,wBAWC;IAED;;;;;;;OAOG;IACH,qBAJW,MAAM,SACN,MAAM,GACJ,IAAI,CAOhB;IA2BD;;;;OAIG;IACH,sBAFW,UAAU,iBA4BpB;IAED;;;;;OAKG;IACH,yBAHW,UAAU,GACR,IAAI,CAqBhB;IAED;;;;;OAKG;IACH,YAHW,MAAM,GACJ,UAAU,GAAC,IAAI,CAQ3B;IAED;;;;;OAKG;IACH,eAHW,MAAM,GACJ,UAAU,EAAE,CAexB;IAeD;;;;;;OAMG;IACH,uBAOC;IAED;;;;;OAKG;IACH,4BAqBC;CACF;;;;;;;;cA5UY,OAAO,KAAK,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libp2p",
3
- "version": "0.36.1",
3
+ "version": "0.36.2",
4
4
  "description": "JavaScript implementation of libp2p, a modular peer to peer network stack",
5
5
  "leadMaintainer": "Jacob Heun <jacobheun@gmail.com>",
6
6
  "main": "src/index.js",
@@ -223,6 +223,12 @@ class ConnectionManager extends EventEmitter {
223
223
  * @param {Connection} connection
224
224
  */
225
225
  async onConnect (connection) {
226
+ if (!this._started) {
227
+ // This can happen when we are in the process of shutting down the node
228
+ await connection.close()
229
+ return
230
+ }
231
+
226
232
  const peerId = connection.remotePeer
227
233
  const peerIdStr = peerId.toB58String()
228
234
  const storedConn = this.connections.get(peerIdStr)
@@ -251,6 +257,11 @@ class ConnectionManager extends EventEmitter {
251
257
  * @returns {void}
252
258
  */
253
259
  onDisconnect (connection) {
260
+ if (!this._started) {
261
+ // This can happen when we are in the process of shutting down the node
262
+ return
263
+ }
264
+
254
265
  const peerId = connection.remotePeer.toB58String()
255
266
  let storedConn = this.connections.get(peerId)
256
267
 
@@ -288,7 +288,7 @@ class PeerStoreAddressBook {
288
288
 
289
289
  updatedPeer = await this._store.mergeOrCreate(peerId, { addresses })
290
290
 
291
- log(`added multiaddrs for ${peerId}`)
291
+ log(`added multiaddrs for ${peerId.toB58String()}`)
292
292
  } finally {
293
293
  log('set release write lock')
294
294
  release()