aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/puppeth/wizard.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-11-24 16:56:33 +0800
committerGitHub <noreply@github.com>2017-11-24 16:56:33 +0800
commitf9569f3cd8a05dff5be5da83a5d8c70c1b23dd3e (patch)
treefa8b344aedb3d56c2cd904173053a5273ec87a67 /cmd/puppeth/wizard.go
parent35801f938e21430f8fb0f2e1c3de5db7dbd21666 (diff)
parenta3a2c6b0d9f963c9377612cae1ed6ded6f216c2d (diff)
downloadgo-tangerine-f9569f3cd8a05dff5be5da83a5d8c70c1b23dd3e.tar
go-tangerine-f9569f3cd8a05dff5be5da83a5d8c70c1b23dd3e.tar.gz
go-tangerine-f9569f3cd8a05dff5be5da83a5d8c70c1b23dd3e.tar.bz2
go-tangerine-f9569f3cd8a05dff5be5da83a5d8c70c1b23dd3e.tar.lz
go-tangerine-f9569f3cd8a05dff5be5da83a5d8c70c1b23dd3e.tar.xz
go-tangerine-f9569f3cd8a05dff5be5da83a5d8c70c1b23dd3e.tar.zst
go-tangerine-f9569f3cd8a05dff5be5da83a5d8c70c1b23dd3e.zip
Merge pull request #15390 from karalabe/puppeth-devcon3
cmd/puppeth: new version as presented at devcon3
Diffstat (limited to 'cmd/puppeth/wizard.go')
-rw-r--r--cmd/puppeth/wizard.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/cmd/puppeth/wizard.go b/cmd/puppeth/wizard.go
index eb6d9e5aa..2e2b4644c 100644
--- a/cmd/puppeth/wizard.go
+++ b/cmd/puppeth/wizard.go
@@ -28,6 +28,7 @@ import (
"sort"
"strconv"
"strings"
+ "sync"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
@@ -38,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"`
}
@@ -75,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.