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:
parent
36045b8ac9
commit
a7f73fef90
@ -54,24 +54,6 @@ export async function describe ({ description }, { me, cost, paymentMethod, sybi
|
||||
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 }) {
|
||||
await notifyDeposit(invoice.userId, invoice)
|
||||
await models.$executeRaw`
|
||||
|
Loading…
x
Reference in New Issue
Block a user