race cond

This commit is contained in:
boufni95 2025-03-14 20:07:26 +00:00
parent c4f7a84eb3
commit 8739515834

View file

@ -127,7 +127,7 @@ export default class {
} }
async AddPendingExternalPayment(userId: string, invoice: string, amounts: { payAmount: number, serviceFee: number, networkFee: number }, linkedApplication: Application, liquidityProvider: string | undefined, txId: string, debitNpub?: string): Promise<UserInvoicePayment> { async AddPendingExternalPayment(userId: string, invoice: string, amounts: { payAmount: number, serviceFee: number, networkFee: number }, linkedApplication: Application, liquidityProvider: string | undefined, txId: string, debitNpub?: string): Promise<UserInvoicePayment> {
const user = await this.userStorage.GetUser(userId) const user = await this.userStorage.GetUser(userId, txId)
return this.dbs.CreateAndSave<UserInvoicePayment>('UserInvoicePayment', { return this.dbs.CreateAndSave<UserInvoicePayment>('UserInvoicePayment', {
user, user,
paid_amount: amounts.payAmount, paid_amount: amounts.payAmount,