mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-09 23:20:28 +00:00
fix sim and run gofmt
This commit is contained in:
parent
240841eb38
commit
da928af361
@ -379,12 +379,12 @@ func dumpDHTSize(store map[[32]byte]*Node) {
|
|||||||
fmt.Printf("DHT min %d / avg %f / max %d\n", min, avg, max)
|
fmt.Printf("DHT min %d / avg %f / max %d\n", min, avg, max)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *Node) startUDP(listen string) {
|
func (n *Node) startTCP(listen string) {
|
||||||
n.core.DEBUG_setupAndStartGlobalUDPInterface(listen)
|
n.core.DEBUG_setupAndStartGlobalTCPInterface(listen)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *Node) connectUDP(remoteAddr string) {
|
func (n *Node) connectTCP(remoteAddr string) {
|
||||||
n.core.DEBUG_maybeSendUDPKeys(remoteAddr)
|
n.core.AddPeer(remoteAddr)
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -440,8 +440,8 @@ func main() {
|
|||||||
if false {
|
if false {
|
||||||
// This connects the sim to the local network
|
// This connects the sim to the local network
|
||||||
for _, node := range kstore {
|
for _, node := range kstore {
|
||||||
node.startUDP("localhost:0")
|
node.startTCP("localhost:0")
|
||||||
node.connectUDP("localhost:12345")
|
node.connectTCP("localhost:12345")
|
||||||
break // just 1
|
break // just 1
|
||||||
}
|
}
|
||||||
for _, node := range kstore {
|
for _, node := range kstore {
|
||||||
|
@ -169,4 +169,3 @@ func (s *searches) checkDHTRes(info *searchInfo, res *dhtRes) bool {
|
|||||||
delete(s.searches, res.Dest)
|
delete(s.searches, res.Dest)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -511,4 +511,3 @@ func (r *dhtRes) decode(bs []byte) bool {
|
|||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user