fixed some bugs around join..

This commit is contained in:
0xdcarns
2022-02-18 20:21:03 -05:00
parent c89ad8d3ce
commit 7bf716429f
3 changed files with 52 additions and 49 deletions

View File

@@ -25,7 +25,7 @@ import (
)
// JoinNetwork - helps a client join a network
func JoinNetwork(cfg config.ClientConfig, privateKey string) error {
func JoinNetwork(cfg config.ClientConfig, privateKey string, iscomms bool) error {
if cfg.Node.Network == "" {
return errors.New("no network provided")
}
@@ -250,16 +250,18 @@ func JoinNetwork(cfg config.ClientConfig, privateKey string) error {
}
}
if cfg.Daemon != "off" {
err = daemon.InstallDaemon(cfg)
}
if err != nil {
return err
} else {
daemon.Restart()
if !iscomms {
if cfg.Daemon != "off" {
err = daemon.InstallDaemon(cfg)
}
if err != nil {
return err
} else {
daemon.Restart()
}
}
return err
return nil
}
// format name appropriately. Set to blank on failure