Skip anon user during trust calculation
This commit is contained in:
parent
6b4b5023f6
commit
f0d0d07bad
|
@ -1,4 +1,5 @@
|
|||
const math = require('mathjs')
|
||||
const { ANON_USER_ID } = require('../lib/constants')
|
||||
|
||||
function trust ({ boss, models }) {
|
||||
return async function () {
|
||||
|
@ -158,6 +159,7 @@ 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})`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue