Add docstring for the update table function

This commit is contained in:
Yohann D'ANELLO 2021-01-05 22:36:09 +01:00
parent 084f512d34
commit acd9b157b9
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 4 additions and 0 deletions

View File

@ -697,6 +697,10 @@ class Squirrel(Hazelnut):
self.update_hazelnut_table(hazelnut)
def update_hazelnut_table(self, hazelnut: Hazelnut) -> None:
"""
We insert the hazelnut into our table of clients.
If there is a collision with the address / the ID, then we merge clients into a unique one.
"""
for addr in hazelnut.addresses:
if addr in self.hazelnuts:
# Merge with the previous hazel