cblgh / trustnet

a flexible and distributed system for deriving, and interacting with, computational trust
GNU Affero General Public License v3.0
134 stars 10 forks source link

Include nodes with weight 0 when trustThreshold is set to 0 #6

Open josephmturner opened 2 years ago

josephmturner commented 2 years ago

Would you be open to including nodes with trust weight 0 in the return value of TrustNet.prototype.getAllTrusted and other methods?

For my particular use-case, changing https://github.com/cblgh/trustnet/blob/7dbb9708cc96c8a3b489576b46bf7b0b2811aeca/trustnet.js#L67 to return Object.entries(this.rankings).filter((e) => e[1] > 0 || this.trustThreshold === 0).map((e) => e[0]).concat(this.rootid) returned the results I wanted. I'm not sure what other changes would need to made for consistency.