Skip to content

Commit

Permalink
cmd/puppeth: make it possible to have pw-protected keyfiles (#22148)
Browse files Browse the repository at this point in the history
  • Loading branch information
holiman committed Nov 2, 2021
1 parent 178debe commit f49e90e
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions cmd/puppeth/wizard_intro.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"os"
"path/filepath"
"strings"
"sync"

"github.com/ethereum/go-ethereum/log"
)
Expand Down Expand Up @@ -80,25 +79,17 @@ func (w *wizard) run() {
} else if err := json.Unmarshal(blob, &w.conf); err != nil {
log.Crit("Previous configuration corrupted", "path", w.conf.path, "err", err)
} else {
// Dial all previously known servers concurrently
var pend sync.WaitGroup
// Dial all previously known 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)
client, err := dial(server, pubkey)
if err != nil {
log.Error("Previous server unreachable", "server", server, "err", err)
}
w.lock.Lock()
w.servers[server] = client
w.lock.Unlock()
}(server, pubkey)
log.Info("Dialing previously configured server", "server", server)
client, err := dial(server, pubkey)
if err != nil {
log.Error("Previous server unreachable", "server", server, "err", err)
}
w.lock.Lock()
w.servers[server] = client
w.lock.Unlock()
}
pend.Wait()
w.networkStats()
}
// Basics done, loop ad infinitum about what to do
Expand Down

0 comments on commit f49e90e

Please sign in to comment.