feat: update to the latest switch (#336)

This commit is contained in:
Jacob Heun
2019-03-21 14:23:00 +01:00
committed by GitHub
parent e52ce66ab7
commit eee60ed37d
3 changed files with 26 additions and 27 deletions

View File

@ -274,13 +274,12 @@ class Node extends EventEmitter {
this._getPeerInfo(peer, (err, peerInfo) => {
if (err) { return callback(err) }
const connFSM = this._switch.dialFSM(peerInfo, protocol, (err) => {
this._switch.dialFSM(peerInfo, protocol, (err, connFSM) => {
if (!err) {
this.peerBook.put(peerInfo)
}
callback(err, connFSM)
})
callback(null, connFSM)
})
}