mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2025-07-01 02:46:20 +00:00
misc dht and tree changes to stabilize coords and bootstrap the dht faster
This commit is contained in:
@ -127,9 +127,9 @@ type switchMessage struct {
|
||||
|
||||
type switchPort uint64
|
||||
type tableElem struct {
|
||||
port switchPort
|
||||
firstSeen time.Time
|
||||
locator switchLocator
|
||||
port switchPort
|
||||
//firstSeen time.Time
|
||||
locator switchLocator
|
||||
}
|
||||
|
||||
type lookupTable struct {
|
||||
@ -304,7 +304,7 @@ func (t *switchTable) handleMessage(msg *switchMessage, fromPort switchPort, sig
|
||||
doUpdate := false
|
||||
if !equiv(&msg.locator, &oldSender.locator) {
|
||||
doUpdate = true
|
||||
sender.firstSeen = now
|
||||
//sender.firstSeen = now
|
||||
}
|
||||
t.data.peers[fromPort] = sender
|
||||
updateRoot := false
|
||||
@ -355,7 +355,7 @@ func (t *switchTable) handleMessage(msg *switchMessage, fromPort switchPort, sig
|
||||
case t.core.router.reset <- struct{}{}:
|
||||
default:
|
||||
}
|
||||
//t.core.log.Println("Switch update:", msg.Locator.Root, msg.Locator.Tstamp, msg.Locator.Coords)
|
||||
//t.core.log.Println("Switch update:", msg.locator.root, msg.locator.tstamp, msg.locator.coords)
|
||||
//fmt.Println("Switch update:", msg.Locator.Root, msg.Locator.Tstamp, msg.Locator.Coords)
|
||||
}
|
||||
if t.data.locator.tstamp != msg.locator.tstamp {
|
||||
@ -397,7 +397,7 @@ func (t *switchTable) updateTable() {
|
||||
newTable.elems = append(newTable.elems, tableElem{
|
||||
locator: loc,
|
||||
//degree: pinfo.degree,
|
||||
firstSeen: pinfo.firstSeen,
|
||||
//firstSeen: pinfo.firstSeen,
|
||||
//forward: pinfo.forward,
|
||||
port: pinfo.port,
|
||||
})
|
||||
|
Reference in New Issue
Block a user