Skip to content

Commit

Permalink
fix: Initial fix for password runtime panic
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolmin authored and fhildeb committed Jul 5, 2023
1 parent 216091a commit 119ed4a
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions commands/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,15 @@ func startValidator(ctx *cli.Context) (err error) {
if err != nil {
err = utils.Exit(fmt.Sprintf("❌ There was an error while reading password: %v", err), 1)
}
}
if err != nil {
return
}

err = ctx.Set(flags.ValidatorWalletPasswordFileFlag, passwordPipe.Name())
if err != nil {
return
err = ctx.Set(flags.ValidatorWalletPasswordFileFlag, passwordPipe.Name())
if err != nil {
return
}
defer func() {
os.Remove(passwordPipe.Name())
}()
}

defer func() {
os.Remove(passwordPipe.Name())
}()

args, err := validatorClient.PrepareStartFlags(ctx)
if err != nil {
err = utils.Exit(fmt.Sprintf("❌ There was an error while preparing %s flags: %v", validatorClient.Name(), err), 1)
Expand All @@ -154,8 +149,6 @@ func startValidator(ctx *cli.Context) (err error) {
err = utils.Exit(fmt.Sprintf("❌ There was an error while starting %s: %v", validatorClient.Name(), err), 1)
}

os.Remove(passwordPipe.Name())

log.Info("⚙️ Please wait a few seconds while your password is being validated...")
time.Sleep(time.Second * 10) // should be enough

Expand Down

0 comments on commit 119ed4a

Please sign in to comment.