From 6e694139f43bb48501fedf12bf65928ed7257ab1 Mon Sep 17 00:00:00 2001 From: keyan Date: Fri, 11 Aug 2023 12:49:50 -0500 Subject: [PATCH] exclude anon from trust graph before algo runs --- worker/trust.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/worker/trust.js b/worker/trust.js index c7119fdd..7de7cd96 100644 --- a/worker/trust.js +++ b/worker/trust.js @@ -119,7 +119,7 @@ async function getGraph (models) { FROM "ItemAct" JOIN "Item" ON "Item".id = "ItemAct"."itemId" AND "ItemAct".act IN ('FEE', 'TIP', 'DONT_LIKE_THIS') AND "Item"."parentId" IS NULL AND NOT "Item".bio AND "Item"."userId" <> "ItemAct"."userId" - JOIN users ON "ItemAct"."userId" = users.id + JOIN users ON "ItemAct"."userId" = users.id AND users.id <> ${ANON_USER_ID} GROUP BY user_id, name, item_id, user_at, against HAVING CASE WHEN "ItemAct".act = 'DONT_LIKE_THIS' THEN sum("ItemAct".msats) > ${AGAINST_MSAT_MIN} @@ -159,7 +159,6 @@ async function storeTrust (models, nodeTrust) { // convert nodeTrust into table literal string let values = '' for (const [id, trust] of Object.entries(nodeTrust)) { - if (id === ANON_USER_ID) continue if (values) values += ',' values += `(${id}, ${trust})` }