make sure to check only pending withdrawals

This commit is contained in:
keyan 2024-01-21 13:24:44 -06:00
parent a3842a9af3
commit a5d7867a13
1 changed files with 1 additions and 1 deletions

View File

@ -200,7 +200,7 @@ async function subscribeToWithdrawals (args) {
}
async function checkWithdrawal ({ data: { hash }, boss, models, lnd }) {
const dbWdrwl = await models.withdrawl.findFirst({ where: { hash } })
const dbWdrwl = await models.withdrawl.findFirst({ where: { hash, status: null } })
if (!dbWdrwl) {
// [WARNING] LND paid an invoice that wasn't created via the SN GraphQL API.
// >>> an adversary might be draining our funds right now <<<