Return box_pub_key as hex again

This commit is contained in:
Neil Alexander 2019-08-04 18:58:51 +01:00
parent a2966291b9
commit 4dd98d7ef3
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -110,7 +110,7 @@ func (a *AdminSocket) Init(c *yggdrasil.Core, state *config.NodeState, log *log.
"bytes_recvd": p.BytesRecvd, "bytes_recvd": p.BytesRecvd,
"proto": p.Protocol, "proto": p.Protocol,
"endpoint": p.Endpoint, "endpoint": p.Endpoint,
"box_pub_key": p.PublicKey, "box_pub_key": hex.EncodeToString(p.PublicKey[:]),
} }
} }
return Info{"peers": peers}, nil return Info{"peers": peers}, nil
@ -128,7 +128,7 @@ func (a *AdminSocket) Init(c *yggdrasil.Core, state *config.NodeState, log *log.
"bytes_recvd": s.BytesRecvd, "bytes_recvd": s.BytesRecvd,
"proto": s.Protocol, "proto": s.Protocol,
"endpoint": s.Endpoint, "endpoint": s.Endpoint,
"box_pub_key": s.PublicKey, "box_pub_key": hex.EncodeToString(s.PublicKey[:]),
} }
} }
return Info{"switchpeers": switchpeers}, nil return Info{"switchpeers": switchpeers}, nil
@ -147,7 +147,7 @@ func (a *AdminSocket) Init(c *yggdrasil.Core, state *config.NodeState, log *log.
dht[so] = Info{ dht[so] = Info{
"coords": fmt.Sprintf("%v", d.Coords), "coords": fmt.Sprintf("%v", d.Coords),
"last_seen": d.LastSeen.Seconds(), "last_seen": d.LastSeen.Seconds(),
"box_pub_key": d.PublicKey, "box_pub_key": hex.EncodeToString(d.PublicKey[:]),
} }
} }
return Info{"dht": dht}, nil return Info{"dht": dht}, nil
@ -164,7 +164,7 @@ func (a *AdminSocket) Init(c *yggdrasil.Core, state *config.NodeState, log *log.
"mtu": s.MTU, "mtu": s.MTU,
"uptime": s.Uptime.Seconds(), "uptime": s.Uptime.Seconds(),
"was_mtu_fixed": s.WasMTUFixed, "was_mtu_fixed": s.WasMTUFixed,
"box_pub_key": s.PublicKey, "box_pub_key": hex.EncodeToString(s.PublicKey[:]),
} }
} }
return Info{"sessions": sessions}, nil return Info{"sessions": sessions}, nil