From d4abde7c8f85b8def516965baf55ee0e5575fb46 Mon Sep 17 00:00:00 2001 From: Rafael Taranto Date: Wed, 29 May 2024 10:37:29 +0100 Subject: [PATCH] fix: wrong comment, no division by zero possible --- lib/plugins/wallet-scoring/scorechain/scorechain.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/plugins/wallet-scoring/scorechain/scorechain.js b/lib/plugins/wallet-scoring/scorechain/scorechain.js index 12f7db9d..872ff5cf 100644 --- a/lib/plugins/wallet-scoring/scorechain/scorechain.js +++ b/lib/plugins/wallet-scoring/scorechain/scorechain.js @@ -37,9 +37,8 @@ function rate (account, objectType, cryptoCode, objectId) { const resScore = res.data?.analysis?.assigned?.result?.score if (!resScore) throw new Error('Failed to get score from Scorechain API') - // normalize score to 0-10 where 0 is the highest risk - // use 101 instead of 100 to avoid division by zero - return { score: (101 - resScore) / 10 - 0.1, isValid: resScore >= threshold } + // normalize score to 0-10 where 0 is the lowest risk + return { score: (100 - resScore) / 10, isValid: resScore >= threshold } }) .catch(err => { throw err