diff --git a/src/pages/api/lightning-address/lnd.js b/src/pages/api/lightning-address/lnd.js index 0e9e6c4..aae76c8 100644 --- a/src/pages/api/lightning-address/lnd.js +++ b/src/pages/api/lightning-address/lnd.js @@ -78,18 +78,16 @@ export default async function handler(req, res) { settled: false }, { ex: expiry || 86400 }); - // Trigger the polling endpoint - try { - await axios.get(`${BACKEND_URL}/api/invoices/short-poll`, { - headers: { - 'Authorization': PLEBDEVS_API_KEY - } - }); - } catch (error) { + // Trigger the polling endpoint without waiting for it + fetch(`${BACKEND_URL}/api/invoices/short-poll`, { + headers: { + 'Authorization': PLEBDEVS_API_KEY + } + }).catch(error => { console.error('Error triggering polling:', error); - // Continue even if polling fails - } + }); + // Return response immediately res.status(200).json({ invoice, payment_hash: paymentHashHex,