Skip to content

Commit

Permalink
Merge pull request #1315 from tahoe-lafs/4046.nurls-are-set
Browse files Browse the repository at this point in the history
Make NURLs a set

Fixes ticket:4046
  • Loading branch information
itamarst committed Jul 20, 2023
2 parents 7bcd90c + aa144fc commit f7f30c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Empty file added newsfragments/4046.minor
Empty file.
6 changes: 5 additions & 1 deletion src/allmydata/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,11 @@ def init_storage(self, announceable_storage_servers):
if hasattr(self.tub.negotiationClass, "add_storage_server"):
nurls = self.tub.negotiationClass.add_storage_server(ss, swissnum.encode("ascii"))
self.storage_nurls = nurls
announcement[storage_client.ANONYMOUS_STORAGE_NURLS] = [n.to_text() for n in nurls]
# There is code in e.g. storage_client.py that checks if an
# announcement has changed. Since NURL order isn't meaningful,
# we don't want a change in the order to count as a change, so we
# send the NURLs as a set. CBOR supports sets, as does Foolscap.
announcement[storage_client.ANONYMOUS_STORAGE_NURLS] = {n.to_text() for n in nurls}
announcement["anonymous-storage-FURL"] = furl

enabled_storage_servers = self._enable_storage_servers(
Expand Down

0 comments on commit f7f30c7

Please sign in to comment.