Skip to content

Commit

Permalink
🐛 fix node being stopped just after launch
Browse files Browse the repository at this point in the history
  • Loading branch information
smolgroot committed Feb 24, 2024
1 parent fcae1de commit 207041a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/utils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func LoadConfiguration(file string) (Config, error) {
var config Config
configFile, err := os.Open(file)
if err != nil {
config = Config{true, "", false, false}
config = Config{false, "", false, false}
return config, err
} else {

Check failure on line 33 in pkg/utils/config.go

View workflow job for this annotation

GitHub Actions / audit

if block ends with a return statement, so drop this else and outdent its block
defer configFile.Close()
Expand Down
2 changes: 1 addition & 1 deletion pkg/vpn/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func BootstrapNode(pk crypto.PrivKey, tcpPort string, udpPort string) (host.Host
}),
)
utils.Check(err)
defer node.Close()
// defer node.Close()

keyBytes, err := crypto.MarshalPrivateKey(node.Peerstore().PrivKey(node.ID()))
utils.Check(err)
Expand Down

0 comments on commit 207041a

Please sign in to comment.