Fix duplicate CLN error

This commit is contained in:
ekzyis 2024-07-08 07:59:28 +02:00
parent 2051dd0e88
commit 8ea4d0c8a7
1 changed files with 11 additions and 18 deletions

View File

@ -61,24 +61,17 @@ export const server = {
{ socket, rune, cert },
{ me, models, addWalletLog, cln: { createInvoice } }
) => {
try {
cert = ensureB64(cert)
const inv = await createInvoice({
socket,
rune,
cert,
description: 'SN connection test',
msats: 'any',
expiry: 0
})
await addWalletLog({ wallet: { type: 'CLN' }, level: 'SUCCESS', message: 'connected to CLN' }, { me, models })
return inv
} catch (err) {
const details = err.details || err.message || err.toString?.()
await addWalletLog({ wallet: { type: 'CLN' }, level: 'ERROR', message: `could not connect to CLN: ${details}` }, { me, models })
throw err
}
cert = ensureB64(cert)
const inv = await createInvoice({
socket,
rune,
cert,
description: 'SN connection test',
msats: 'any',
expiry: 0
})
await addWalletLog({ wallet: { type: 'CLN' }, level: 'SUCCESS', message: 'connected to CLN' }, { me, models })
return inv
},
createInvoice: async (
{ amount },