mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-22 15:20:30 +00:00
Fix bugs
This commit is contained in:
parent
f19a4e4398
commit
4c0c3a23cb
@ -189,8 +189,8 @@ func main() {
|
|||||||
var err error
|
var err error
|
||||||
switch {
|
switch {
|
||||||
case *version:
|
case *version:
|
||||||
fmt.Println("Build name:", yggdrasil.GetBuildName())
|
fmt.Println("Build name:", yggdrasil.BuildName())
|
||||||
fmt.Println("Build version:", yggdrasil.GetBuildVersion())
|
fmt.Println("Build version:", yggdrasil.BuildVersion())
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
case *autoconf:
|
case *autoconf:
|
||||||
// Use an autoconf-generated config, this will give us random keys and
|
// Use an autoconf-generated config, this will give us random keys and
|
||||||
@ -269,8 +269,8 @@ func main() {
|
|||||||
}()
|
}()
|
||||||
// Make some nice output that tells us what our IPv6 address and subnet are.
|
// Make some nice output that tells us what our IPv6 address and subnet are.
|
||||||
// This is just logged to stdout for the user.
|
// This is just logged to stdout for the user.
|
||||||
address := n.core.GetAddress()
|
address := n.core.Address()
|
||||||
subnet := n.core.GetSubnet()
|
subnet := n.core.Subnet()
|
||||||
logger.Infof("Your IPv6 address is %s", address.String())
|
logger.Infof("Your IPv6 address is %s", address.String())
|
||||||
logger.Infof("Your IPv6 subnet is %s", subnet.String())
|
logger.Infof("Your IPv6 subnet is %s", subnet.String())
|
||||||
// Catch interrupts from the operating system to exit gracefully.
|
// Catch interrupts from the operating system to exit gracefully.
|
||||||
|
@ -642,14 +642,14 @@ func (a *admin) getData_getSelf() *admin_nodeInfo {
|
|||||||
coords := table.self.getCoords()
|
coords := table.self.getCoords()
|
||||||
self := admin_nodeInfo{
|
self := admin_nodeInfo{
|
||||||
{"box_pub_key", hex.EncodeToString(a.core.boxPub[:])},
|
{"box_pub_key", hex.EncodeToString(a.core.boxPub[:])},
|
||||||
{"ip", a.core.GetAddress().String()},
|
{"ip", a.core.Address().String()},
|
||||||
{"subnet", a.core.GetSubnet().String()},
|
{"subnet", a.core.Subnet().String()},
|
||||||
{"coords", fmt.Sprint(coords)},
|
{"coords", fmt.Sprint(coords)},
|
||||||
}
|
}
|
||||||
if name := GetBuildName(); name != "unknown" {
|
if name := BuildName(); name != "unknown" {
|
||||||
self = append(self, admin_pair{"build_name", name})
|
self = append(self, admin_pair{"build_name", name})
|
||||||
}
|
}
|
||||||
if version := GetBuildVersion(); version != "unknown" {
|
if version := BuildVersion(); version != "unknown" {
|
||||||
self = append(self, admin_pair{"build_version", version})
|
self = append(self, admin_pair{"build_version", version})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -267,12 +267,12 @@ func (c *Core) NewSigningKeys() (*crypto.SigPubKey, *crypto.SigPrivKey) {
|
|||||||
|
|
||||||
// NodeID gets the node ID.
|
// NodeID gets the node ID.
|
||||||
func (c *Core) NodeID() *crypto.NodeID {
|
func (c *Core) NodeID() *crypto.NodeID {
|
||||||
return crypto.NodeID(&c.boxPub)
|
return crypto.GetNodeID(&c.boxPub)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TreeID gets the tree ID.
|
// TreeID gets the tree ID.
|
||||||
func (c *Core) TreeID() *crypto.TreeID {
|
func (c *Core) TreeID() *crypto.TreeID {
|
||||||
return crypto.TreeID(&c.sigPub)
|
return crypto.GetTreeID(&c.sigPub)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Address gets the IPv6 address of the Yggdrasil node. This is always a /128
|
// Address gets the IPv6 address of the Yggdrasil node. This is always a /128
|
||||||
|
@ -86,7 +86,7 @@ func (t *dht) init(c *Core) {
|
|||||||
e <- nil
|
e <- nil
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
t.nodeID = *t.core.GetNodeID()
|
t.nodeID = *t.core.NodeID()
|
||||||
t.peers = make(chan *dhtInfo, 1024)
|
t.peers = make(chan *dhtInfo, 1024)
|
||||||
t.callbacks = make(map[dhtReqKey]dht_callbackInfo)
|
t.callbacks = make(map[dhtReqKey]dht_callbackInfo)
|
||||||
t.reset()
|
t.reset()
|
||||||
|
@ -101,8 +101,8 @@ func (m *nodeinfo) setNodeInfo(given interface{}, privacy bool) error {
|
|||||||
m.myNodeInfoMutex.Lock()
|
m.myNodeInfoMutex.Lock()
|
||||||
defer m.myNodeInfoMutex.Unlock()
|
defer m.myNodeInfoMutex.Unlock()
|
||||||
defaults := map[string]interface{}{
|
defaults := map[string]interface{}{
|
||||||
"buildname": GetBuildName(),
|
"buildname": BuildName(),
|
||||||
"buildversion": GetBuildVersion(),
|
"buildversion": BuildVersion(),
|
||||||
"buildplatform": runtime.GOOS,
|
"buildplatform": runtime.GOOS,
|
||||||
"buildarch": runtime.GOARCH,
|
"buildarch": runtime.GOARCH,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user