chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <jacobheun@gmail.com>
This commit is contained in:
Vasco Santos
2020-04-27 16:11:25 +02:00
committed by Jacob Heun
parent d3a4bf0a3f
commit 9e9ec0b575
2 changed files with 2 additions and 7 deletions

View File

@ -9,7 +9,6 @@ const retimer = require('retimer')
const { EventEmitter } = require('events')
const PeerId = require('peer-id')
const { Connection } = require('libp2p-interfaces/src/connection')
const {
ERR_INVALID_PARAMETERS
@ -172,10 +171,6 @@ class ConnectionManager extends EventEmitter {
* @param {Connection} connection
*/
onConnect (connection) {
if (!Connection.isConnection(connection)) {
throw errcode(new Error('conn must be an instance of interface-connection'), ERR_INVALID_PARAMETERS)
}
const peerId = connection.remotePeer.toB58String()
const storedConn = this.connections.get(peerId)