don't join buckets if there is only one

This commit is contained in:
Jack Robison 2019-02-21 14:18:48 -05:00
parent c52541197f
commit 3868dea819
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -281,6 +281,8 @@ class TreeRoutingTable:
old_bucket.remove_peer(contact) old_bucket.remove_peer(contact)
def join_buckets(self): def join_buckets(self):
if len(self.buckets) == 1:
return
to_pop = [i for i, bucket in enumerate(self.buckets) if not len(bucket)] to_pop = [i for i, bucket in enumerate(self.buckets) if not len(bucket)]
if not to_pop: if not to_pop:
return return