diff --git a/src/modules/plugins/rpc.ts b/src/modules/plugins/rpc.ts index a818e18..4c13e85 100644 --- a/src/modules/plugins/rpc.ts +++ b/src/modules/plugins/rpc.ts @@ -127,7 +127,16 @@ const plugin: Plugin = { api.registerMethod("get_peers", { cacheable: false, async handler(): Promise { - return [...getRpcServer().cache.dhtCache.online]; + const pubkey = b4a + .from(getRpcServer().cache.swarm.keyPair.publicKey) + .toString("hex"); + + const online = getRpcServer().cache.dhtCache.online; + if (online.has(pubkey)) { + online.delete(pubkey); + } + + return [...online]; }, }); api.registerMethod("get_direct_peers", {