mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
Remove isAutoconf option to GenerateConfig
This commit is contained in:
parent
4062c93e18
commit
41872820c3
3 changed files with 7 additions and 7 deletions
|
@ -61,7 +61,7 @@ type SwitchOptions struct {
|
|||
// or whether to generate a random port number. The only side effect of setting
|
||||
// isAutoconf is that the TCP and UDP ports will likely end up with different
|
||||
// port numbers.
|
||||
func GenerateConfig(isAutoconf bool) *NodeConfig {
|
||||
func GenerateConfig() *NodeConfig {
|
||||
// Generate encryption keys.
|
||||
bpub, bpriv := crypto.NewBoxKeys()
|
||||
spub, spriv := crypto.NewSigKeys()
|
||||
|
|
|
@ -45,7 +45,7 @@ func (c *Core) addStaticPeers(cfg *config.NodeConfig) {
|
|||
func (c *Core) StartAutoconfigure() error {
|
||||
mobilelog := MobileLogger{}
|
||||
logger := log.New(mobilelog, "", 0)
|
||||
nc := config.GenerateConfig(true)
|
||||
nc := config.GenerateConfig()
|
||||
nc.IfName = "dummy"
|
||||
nc.AdminListen = "tcp://localhost:9001"
|
||||
nc.Peers = []string{}
|
||||
|
@ -64,7 +64,7 @@ func (c *Core) StartAutoconfigure() error {
|
|||
func (c *Core) StartJSON(configjson []byte) error {
|
||||
mobilelog := MobileLogger{}
|
||||
logger := log.New(mobilelog, "", 0)
|
||||
nc := config.GenerateConfig(false)
|
||||
nc := config.GenerateConfig()
|
||||
var dat map[string]interface{}
|
||||
if err := hjson.Unmarshal(configjson, &dat); err != nil {
|
||||
return err
|
||||
|
@ -82,7 +82,7 @@ func (c *Core) StartJSON(configjson []byte) error {
|
|||
|
||||
// Generates mobile-friendly configuration in JSON format.
|
||||
func GenerateConfigJSON() []byte {
|
||||
nc := config.GenerateConfig(false)
|
||||
nc := config.GenerateConfig()
|
||||
nc.IfName = "dummy"
|
||||
if json, err := json.Marshal(nc); err == nil {
|
||||
return json
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue