Skip to content

Commit

Permalink
Add FIXME
Browse files Browse the repository at this point in the history
  • Loading branch information
ekzyis committed Jan 6, 2024
1 parent 65cc0dd commit d5a5103
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion worker/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ async function checkInvoice ({ data: { hash }, boss, models, lnd }) {
}
console.log(inv)

// check if invoice still exists since HODL invoices get deleted after usage
// check if invoice exists since it might just have been created by LND and wasn't inserted into the database yet
// but that is not a problem since this function will be called again with the update
// FIXME: there might be a race condition here if the invoice gets paid before the invoice was inserted into the db.
const dbInv = await models.invoice.findUnique({ where: { hash } })
if (!dbInv) {
console.log('invoice not found in database', hash)
Expand Down

0 comments on commit d5a5103

Please sign in to comment.