misc dht and tree changes to stabilize coords and bootstrap the dht faster

This commit is contained in:
Arceliar 2018-05-15 23:57:00 -05:00
parent 96c55da987
commit 8228242eed
4 changed files with 57 additions and 27 deletions

View file

@ -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,
})