mirror of https://codeberg.org/pzp/zooboard.git
fix proto-scheduler: do not connect to self tunnel
This commit is contained in:
parent
0a70f2e31c
commit
649d77618c
5
main.js
5
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)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue