Skip to content

Commit

Permalink
Risk force re-check (#3975)
Browse files Browse the repository at this point in the history
  • Loading branch information
piekczyk authored Jun 28, 2024
1 parent dec0b54 commit 0385345
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions handlers/risk/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,16 @@ export async function getRisk(req: NextApiRequest, res: NextApiResponse) {
return res.status(200).json({ isRisky })
}

// force re-check if wallet is still flagged as risky
// it's necessary for cases where provider flags user as risky by mistake
// and after a short period of time it's fixed on provider side
if (risk.is_risky) {
const isRisky = await checkIfRisky(user.address)
await updateRiskForAddress(prisma, user.address, isRisky)

return res.status(200).json({ isRisky })
}

const lastCheckTime = new Date(risk.last_check).getTime()
const now = new Date().getTime()

Expand Down

0 comments on commit 0385345

Please sign in to comment.