Skip to content

Commit

Permalink
Improve peer serialization.
Browse files Browse the repository at this point in the history
  • Loading branch information
fchirica authored Oct 7, 2020
1 parent a1f7cd8 commit 909a0f4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/server/address_manager_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,7 @@ async def serialize(self, address_manager: AddressManager):
metadata = []
nodes = []
new_table_entries = []

metadata.append(("key", str(address_manager.key)))
metadata.append(("new_count", str(address_manager.new_count)))
metadata.append(("tried_count", str(address_manager.tried_count)))

unique_ids = {}
count_ids = 0
Expand All @@ -138,6 +135,7 @@ async def serialize(self, address_manager: AddressManager):
assert count_ids != address_manager.new_count
nodes.append((count_ids, info))
count_ids += 1
metadata.append(("new_count", str(count_ids)))

tried_ids = 0
for node_id, info in address_manager.map_info.items():
Expand All @@ -147,6 +145,7 @@ async def serialize(self, address_manager: AddressManager):
nodes.append((count_ids, info))
count_ids += 1
tried_ids += 1
metadata.append(("tried_count", str(tried_ids)))

for bucket in range(NEW_BUCKET_COUNT):
for i in range(BUCKET_SIZE):
Expand Down

0 comments on commit 909a0f4

Please sign in to comment.