Implement auto refresh of buckets. Close #11

This commit is contained in:
Kleissner
2021-04-24 23:06:08 +02:00
parent 6693d442a6
commit 63e736486a
5 changed files with 30 additions and 5 deletions

View File

@@ -172,6 +172,8 @@ func networkChangeInterfaceNew(iface net.Interface, addresses []net.Addr) {
log.Printf("networkChangeInterfaceNew new interface '%s' (%d IPs)\n", iface.Name, len(addresses))
networkStart(iface, addresses)
go nodesDHT.RefreshBuckets(0)
}
// networkChangeInterfaceRemove is called when an existing interface is removed
@@ -213,6 +215,8 @@ func networkChangeIPNew(iface net.Interface, address net.Addr) {
log.Printf("networkChangeIPNew new interface '%s' IP %s\n", iface.Name, address.String())
networkStart(iface, []net.Addr{address})
go nodesDHT.RefreshBuckets(0)
}
// networkChangeIPRemove is called when an existing interface removes an IP