diff --git a/cmd/devp2p/crawl.go b/cmd/devp2p/crawl.go index 7fefbd7a1c..ba4c4e05d2 100644 --- a/cmd/devp2p/crawl.go +++ b/cmd/devp2p/crawl.go @@ -45,7 +45,7 @@ func newCrawler(input nodeSet, disc *discover.UDPv4, iters ...enode.Iterator) *c iters: iters, inputIter: enode.IterNodes(input.nodes()), ch: make(chan *enode.Node), - closed: make(chan struct{}), + closed: make(chan struct{}, 1), } c.iters = append(c.iters, c.inputIter) // Copy input to output initially. Any nodes that fail validation diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go index a3ee45ba7f..ede1016add 100644 --- a/cmd/utils/cmd.go +++ b/cmd/utils/cmd.go @@ -89,7 +89,7 @@ func ImportChain(chain *core.BlockChain, fn string) error { // Watch for Ctrl-C while the import is running. // If a signal is received, the import will stop at the next batch. interrupt := make(chan os.Signal, 1) - stop := make(chan struct{}) + stop := make(chan struct{}, 1) signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) defer signal.Stop(interrupt) defer close(interrupt) diff --git a/cmd/wnode/main.go b/cmd/wnode/main.go index a94ed947d0..f055386ca0 100644 --- a/cmd/wnode/main.go +++ b/cmd/wnode/main.go @@ -175,7 +175,7 @@ func echo() { func initialize() { log.Root().SetHandler(log.LvlFilterHandler(log.Lvl(*argVerbosity), log.StreamHandler(os.Stderr, log.TerminalFormat(false)))) - done = make(chan struct{}) + done = make(chan struct{}, 1) var peers []*enode.Node var err error