diff --git a/node/node.go b/node/node.go index e14a461fb..5e30dea0a 100644 --- a/node/node.go +++ b/node/node.go @@ -6,6 +6,7 @@ import ( "fmt" "net" "sync" + "time" "github.com/simple-rules/harmony-benchmark/blockchain" "github.com/simple-rules/harmony-benchmark/client" @@ -93,11 +94,13 @@ func (node *Node) listenOnPort(port string) { return } defer listen.Close() + backoff := p2p.NewExpBackoff(250*time.Millisecond, 15*time.Second, 2.0) for { conn, err := listen.Accept() if err != nil { node.log.Error("Error listening on port.", "port", port, "err", err) + backoff.Sleep() continue } go node.NodeHandler(conn)