aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/puppeth/wizard.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/puppeth/wizard.go')
-rw-r--r--cmd/puppeth/wizard.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/cmd/puppeth/wizard.go b/cmd/puppeth/wizard.go
index 5fbc11cb9..2e2b4644c 100644
--- a/cmd/puppeth/wizard.go
+++ b/cmd/puppeth/wizard.go
@@ -28,7 +28,7 @@ import (
"sort"
"strconv"
"strings"
- "syscall"
+ "sync"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
@@ -39,12 +39,12 @@ import (
// config contains all the configurations needed by puppeth that should be saved
// between sessions.
type config struct {
- path string // File containing the configuration values
- genesis *core.Genesis // Genesis block to cache for node deploys
- bootFull []string // Bootnodes to always connect to by full nodes
- bootLight []string // Bootnodes to always connect to by light nodes
- ethstats string // Ethstats settings to cache for node deploys
+ path string // File containing the configuration values
+ bootFull []string // Bootnodes to always connect to by full nodes
+ bootLight []string // Bootnodes to always connect to by light nodes
+ ethstats string // Ethstats settings to cache for node deploys
+ Genesis *core.Genesis `json:"genesis,omitempty"` // Genesis block to cache for node deploys
Servers map[string][]byte `json:"servers,omitempty"`
}
@@ -76,7 +76,8 @@ type wizard struct {
servers map[string]*sshClient // SSH connections to servers to administer
services map[string][]string // Ethereum services known to be running on servers
- in *bufio.Reader // Wrapper around stdin to allow reading user input
+ in *bufio.Reader // Wrapper around stdin to allow reading user input
+ lock sync.Mutex // Lock to protect configs during concurrent service discovery
}
// read reads a single line from stdin, trimming if from spaces.
@@ -231,7 +232,7 @@ func (w *wizard) readDefaultFloat(def float64) float64 {
// line and returns it. The input will not be echoed.
func (w *wizard) readPassword() string {
fmt.Printf("> ")
- text, err := terminal.ReadPassword(int(syscall.Stdin))
+ text, err := terminal.ReadPassword(int(os.Stdin.Fd()))
if err != nil {
log.Crit("Failed to read password", "err", err)
}