Skip to content

Commit

Permalink
rollback previous changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Kiel committed Dec 3, 2021
1 parent d618774 commit c7eba7b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,16 +543,16 @@ class Libp2p extends EventEmitter {
* @param {PeerId|Multiaddr|string} peer - the peer to close connections to
* @returns {Promise<void>}
*/
hangUp (peer) {
const peerInfo = getPeerInfo(peer, this.peerStore)
async hangUp (peer) {
const { id } = getPeer(peer)

let connections = this.registrar.connections.get(peerInfo.id.toB58String())
const connections = this.connectionManager.connections.get(id.toB58String())

if (!connections) {
return Promise.resolve()
return
}

return Promise.all(
await Promise.all(
connections.map(connection => {
return connection.close()
})
Expand Down

0 comments on commit c7eba7b

Please sign in to comment.