diff --git a/src/network.ts b/src/network.ts index 349f2d9..bc0a23b 100644 --- a/src/network.ts +++ b/src/network.ts @@ -116,7 +116,7 @@ export default class RpcNetwork { this._swarm.on("connection", async (relay: any) => { const pubkey = b4a.from(relay.remotePublicKey).toString("hex"); - relay.on("close", () => { + relay.once("close", () => { this._methods.forEach((item) => { if (item.has(pubkey)) { item.delete(pubkey);