Fix duplicate CLN error
This commit is contained in:
parent
2051dd0e88
commit
8ea4d0c8a7
|
@ -61,24 +61,17 @@ export const server = {
|
||||||
{ socket, rune, cert },
|
{ socket, rune, cert },
|
||||||
{ me, models, addWalletLog, cln: { createInvoice } }
|
{ me, models, addWalletLog, cln: { createInvoice } }
|
||||||
) => {
|
) => {
|
||||||
try {
|
cert = ensureB64(cert)
|
||||||
cert = ensureB64(cert)
|
const inv = await createInvoice({
|
||||||
|
socket,
|
||||||
const inv = await createInvoice({
|
rune,
|
||||||
socket,
|
cert,
|
||||||
rune,
|
description: 'SN connection test',
|
||||||
cert,
|
msats: 'any',
|
||||||
description: 'SN connection test',
|
expiry: 0
|
||||||
msats: 'any',
|
})
|
||||||
expiry: 0
|
await addWalletLog({ wallet: { type: 'CLN' }, level: 'SUCCESS', message: 'connected to CLN' }, { me, models })
|
||||||
})
|
return inv
|
||||||
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
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
createInvoice: async (
|
createInvoice: async (
|
||||||
{ amount },
|
{ amount },
|
||||||
|
|
Loading…
Reference in New Issue