diff --git a/mesh.js b/mesh.js index e6c6ee0..770aee5 100644 --- a/mesh.js +++ b/mesh.js @@ -3,7 +3,7 @@ const Protomux = require('protomux') const b4a = require('b4a') const { encodeRpc, decodeRpc } = require('pearcord-shared') -const { openWireChannel } = require('pearcord-drive/mux-wire') +const { openWireChannel, wireReady } = require('pearcord-drive/mux-wire') const CONTACTS_PROTOCOL = 'pearcord-contacts-v1' @@ -30,7 +30,7 @@ async function broadcastContactsGossip (contacts, method, payload) { await Promise.all( sessions.map(async (session) => { try { - const ok = await session.fullyOpened().catch(() => false) + const ok = await wireReady(session, 6000) if (!ok) return session.send(buf) } catch {