Skip to content

Commit

Permalink
Fixed inadverdent trust level warning
Browse files Browse the repository at this point in the history
  • Loading branch information
markqvist committed Mar 2, 2024
1 parent d9bba6f commit f1989cf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions nomadnet/Directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,12 @@ def trust_level(self, source_hash, announced_display_name=None):
if announced_display_name == None:
return self.directory_entries[source_hash].trust_level
else:
for entry in self.directory_entries:
e = self.directory_entries[entry]
if e.display_name == announced_display_name:
if e.source_hash != source_hash:
return DirectoryEntry.WARNING
if not self.directory_entries[source_hash].trust_level == DirectoryEntry.TRUSTED:
for entry in self.directory_entries:
e = self.directory_entries[entry]
if e.display_name == announced_display_name:
if e.source_hash != source_hash:
return DirectoryEntry.WARNING

return self.directory_entries[source_hash].trust_level
else:
Expand Down

0 comments on commit f1989cf

Please sign in to comment.