forked from cerc-io/plugeth
cmd/puppeth: make it possible to have pw-protected keyfiles (#22148)
This commit is contained in:
parent
178debe435
commit
f49e90e32c
@ -23,7 +23,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/log"
|
"github.com/ethereum/go-ethereum/log"
|
||||||
)
|
)
|
||||||
@ -80,14 +79,8 @@ func (w *wizard) run() {
|
|||||||
} else if err := json.Unmarshal(blob, &w.conf); err != nil {
|
} else if err := json.Unmarshal(blob, &w.conf); err != nil {
|
||||||
log.Crit("Previous configuration corrupted", "path", w.conf.path, "err", err)
|
log.Crit("Previous configuration corrupted", "path", w.conf.path, "err", err)
|
||||||
} else {
|
} else {
|
||||||
// Dial all previously known servers concurrently
|
// Dial all previously known servers
|
||||||
var pend sync.WaitGroup
|
|
||||||
for server, pubkey := range w.conf.Servers {
|
for server, pubkey := range w.conf.Servers {
|
||||||
pend.Add(1)
|
|
||||||
|
|
||||||
go func(server string, pubkey []byte) {
|
|
||||||
defer pend.Done()
|
|
||||||
|
|
||||||
log.Info("Dialing previously configured server", "server", server)
|
log.Info("Dialing previously configured server", "server", server)
|
||||||
client, err := dial(server, pubkey)
|
client, err := dial(server, pubkey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -96,9 +89,7 @@ func (w *wizard) run() {
|
|||||||
w.lock.Lock()
|
w.lock.Lock()
|
||||||
w.servers[server] = client
|
w.servers[server] = client
|
||||||
w.lock.Unlock()
|
w.lock.Unlock()
|
||||||
}(server, pubkey)
|
|
||||||
}
|
}
|
||||||
pend.Wait()
|
|
||||||
w.networkStats()
|
w.networkStats()
|
||||||
}
|
}
|
||||||
// Basics done, loop ad infinitum about what to do
|
// Basics done, loop ad infinitum about what to do
|
||||||
|
Loading…
Reference in New Issue
Block a user