Remove unused onPaid for RECEIVE paid action (#2229)

This function can be removed because it will never do anything when called.

It does not do anything for wrapped invoices, and it will never get called for direct payments (since we don't know when the invoice was paid).

These are the only two payment methods for the RECEIVE paid action since 5a8804d.
This commit is contained in:
ekzyis 2025-06-15 03:39:02 +02:00 committed by GitHub
parent 36045b8ac9
commit a7f73fef90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -54,24 +54,6 @@ export async function describe ({ description }, { me, cost, paymentMethod, sybi
return description ?? `SN: ${me?.name ?? ''} receives ${numWithUnits(msatsToSats(cost - fee))}` return description ?? `SN: ${me?.name ?? ''} receives ${numWithUnits(msatsToSats(cost - fee))}`
} }
export async function onPaid ({ invoice }, { tx }) {
if (!invoice) {
throw new Error('invoice is required')
}
// P2P lnurlp does not need to update the user's balance
if (invoice?.invoiceForward) return
await tx.user.update({
where: { id: invoice.userId },
data: {
mcredits: {
increment: invoice.msatsReceived
}
}
})
}
export async function nonCriticalSideEffects ({ invoice }, { models }) { export async function nonCriticalSideEffects ({ invoice }, { models }) {
await notifyDeposit(invoice.userId, invoice) await notifyDeposit(invoice.userId, invoice)
await models.$executeRaw` await models.$executeRaw`