set macaddress and nodeid if not set

This commit is contained in:
Matthew R. Kasun
2022-02-14 14:13:18 -05:00
committed by 0xdcarns
parent 5c35ca433e
commit e1bba1d89f
2 changed files with 8 additions and 2 deletions

View File

@@ -103,7 +103,8 @@ func JoinNetwork(cfg config.ClientConfig, privateKey string) error {
if cfg.Node.MacAddress == "" {
macs, err := ncutils.GetMacAddr()
if err != nil {
return err
//if macaddress can't be found set to random string
cfg.Node.MacAddress = ncutils.MakeRandomString(18)
} else {
cfg.Node.MacAddress = macs[0]
}