Skip to content

Commit

Permalink
Ensure peer disconnects
Browse files Browse the repository at this point in the history
  • Loading branch information
acolytec3 committed May 17, 2023
1 parent 5da5bb1 commit e4ecd4e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/devp2p/src/rlpx/rlpx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,11 @@ export class RLPx extends EventEmitter {

disconnect(id: Uint8Array) {
const peer = this._peers.get(bytesToHex(id))
if (peer instanceof Peer) peer.disconnect(DISCONNECT_REASONS.CLIENT_QUITTING)
if (peer instanceof Peer) {
peer.disconnect(DISCONNECT_REASONS.CLIENT_QUITTING)
peer._onSocketClose()
}
if (peer instanceof net.Socket) peer.destroy()
}

_isAlive() {
Expand Down

0 comments on commit e4ecd4e

Please sign in to comment.