Update the full hazelnuts table when adding a new potential neighbour
This commit is contained in:
parent
311e1539f9
commit
95a2501e49
|
@ -229,8 +229,9 @@ class NeighbourTLV(TLV):
|
|||
return
|
||||
if not (str(self.ip_address), self.port) in squirrel.activehazelnuts \
|
||||
and not (str(self.ip_address), self.port) in squirrel.potentialhazelnuts:
|
||||
squirrel.potentialhazelnuts[(str(self.ip_address), self.port)] = \
|
||||
squirrel.new_hazel(str(self.ip_address), self.port)
|
||||
hazelnut = squirrel.new_hazel(str(self.ip_address), self.port)
|
||||
hazelnut.potential = True
|
||||
squirrel.update_hazelnut_table(hazelnut)
|
||||
# squirrel.add_system_message(f"New potential friend {self.ip_address}:{self.port}!")
|
||||
|
||||
@staticmethod
|
||||
|
|
|
@ -78,7 +78,8 @@ class Squinnondation:
|
|||
|
||||
if instance.args.client_address and instance.args.client_port:
|
||||
hazelnut = Hazelnut(address=instance.args.client_address, port=instance.args.client_port)
|
||||
squirrel.potentialhazelnuts[instance.args.client_address, instance.args.client_port] = hazelnut
|
||||
hazelnut.potential = True
|
||||
squirrel.update_hazelnut_table(hazelnut)
|
||||
htlv = HelloTLV().construct(8, squirrel)
|
||||
pkt = Packet().construct(htlv)
|
||||
squirrel.send_packet(hazelnut, pkt)
|
||||
|
|
Loading…
Reference in New Issue