From 649d77618c60cd2acaf2d9b5b3fcd15faf52dc5b Mon Sep 17 00:00:00 2001 From: Andre Staltz Date: Wed, 24 Jan 2024 16:02:23 +0200 Subject: [PATCH] fix proto-scheduler: do not connect to self tunnel --- main.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.js b/main.js index 9a16dd5..a927784 100644 --- a/main.js +++ b/main.js @@ -210,7 +210,7 @@ async function scheduleWithHub(multiaddr) { // FIXME: this should be in the ppppp-net scheduler for await (const attendants of awaitable(hubRPC.hub.attendants())) { for (const attendant of attendants) { - if (attendant !== peer.pubkey) { + if (attendant !== peer.shse.pubkey) { const tunnelMultiaddr = `/tunnel/${hubRPC.shse.pubkey}.${attendant}/shse/${attendant}` peer.net.connect(tunnelMultiaddr) } @@ -253,8 +253,7 @@ async function handlePPPPPUri(uri) { peer.addListener('rpc:connect', function onConnect(rpc) { if (rpc.shse.pubkey === issuerPubkey) { rpc.promise.follow(command.token, globalAccountID, (err) => { - if (err) - return console.error('Failed to claim follow promise', err) + if (err) return console.error('Failed to use follow promise', err) peer.removeListener('rpc:connect', onConnect) }) }