🚧 Disregard identities that don’t trust anyone
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 17 Apr 2020 23:29:40 +0000 (01:29 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 17 Apr 2020 23:29:40 +0000 (01:29 +0200)
src/main/kotlin/net/pterodactylus/sone/freenet/wot/IdentityManagerImpl.kt

index 5f087c7..f0e08d4 100644 (file)
@@ -60,7 +60,7 @@ class IdentityManagerImpl @Inject constructor(
 
                                val onlyTrustedByAll = currentIdentities.mapValues { (ownIdentity, trustedIdentities) ->
                                        trustedIdentities.filter { trustedIdentity ->
 
                                val onlyTrustedByAll = currentIdentities.mapValues { (ownIdentity, trustedIdentities) ->
                                        trustedIdentities.filter { trustedIdentity ->
-                                               currentIdentities.all { trustedIdentity in it.value }
+                                               currentIdentities.filterValues { it.isNotEmpty() }.all { trustedIdentity in it.value }
                                        }
                                }
                                logger.log(Level.FINE, "Reduced (${currentIdentities.size},(${currentIdentities.values.joinToString { it.size.toString() }})) identities to (${onlyTrustedByAll.size},(${onlyTrustedByAll.values.joinToString { it.size.toString() }})).")
                                        }
                                }
                                logger.log(Level.FINE, "Reduced (${currentIdentities.size},(${currentIdentities.values.joinToString { it.size.toString() }})) identities to (${onlyTrustedByAll.size},(${onlyTrustedByAll.values.joinToString { it.size.toString() }})).")