maidsafe / safe_network

72 stars 40 forks source link

feat(networking): remove self.close_group and checks there as unused #1975

Closed joshuef closed 1 month ago

joshuef commented 1 month ago

check_close_group bool was never used, and only effect was updating self for use in the call of that fn.

This pull request primarily focuses on removing the concept of a 'close group' from the SwarmDriver in the sn_networking module. The 'close group' was previously used to keep track of the closest peers to our PeerId, but it has now been removed from the NetworkBuilder and SwarmDriver structures. This change also leads to the removal of the check_for_change_in_our_close_group method, which was used to update the 'close group'. The method was called in several places throughout the code, and these calls have been removed as part of this pull request.

Here are the key changes:

Removal of 'close group':

Removal of 'close group' update method:

Removal of 'close group' update calls:

Cleanup of unused imports: