Skip to content
This repository was archived by the owner on Aug 23, 2019. It is now read-only.

Commit

Permalink
fix(hangup): change order of listen for close and ending muxer (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
victorb authored and daviddias committed Jan 26, 2017
1 parent c82d0e8 commit 4de013d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ function Swarm (peerInfo) {
const key = peerInfo.id.toB58String()
if (this.muxedConns[key]) {
const muxer = this.muxedConns[key].muxer
muxer.end()
muxer.once('close', () => {
delete this.muxedConns[key]
callback()
})
muxer.end()
} else {
callback()
}
Expand Down

0 comments on commit 4de013d

Please sign in to comment.