fix proto-scheduler: do not connect to self tunnel

This commit is contained in:
Andre Staltz 2024-01-24 16:02:23 +02:00
parent 0a70f2e31c
commit 649d77618c
No known key found for this signature in database
GPG Key ID: 9EDE23EA7E8A4890
1 changed files with 2 additions and 3 deletions

View File

@ -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)
})
}