From 14f81db0380f8562a189729e355aebf4a46cf438 Mon Sep 17 00:00:00 2001 From: ledgerwatch Date: Thu, 25 Nov 2021 18:36:15 +0000 Subject: [PATCH] Not try to create temporary file with enode (#3035) * Update server.go * Update server.go --- p2p/server.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/p2p/server.go b/p2p/server.go index 2277ed4a3..aad830476 100644 --- a/p2p/server.go +++ b/p2p/server.go @@ -23,10 +23,7 @@ import ( "encoding/hex" "errors" "fmt" - "io/ioutil" "net" - "os" - "path" "sort" "sync" "sync/atomic" @@ -68,8 +65,6 @@ const ( frameWriteTimeout = 20 * time.Second ) -var EnodeAddressFileName = path.Join(os.TempDir(), "enode_address.tmp") - var errServerStopped = errors.New("server stopped") // Config holds Server options. @@ -718,12 +713,6 @@ func (srv *Server) doPeerOp(fn peerOpFunc) { // run is the main loop of the server. func (srv *Server) run() { defer debug.LogPanic() - if srv.localnode.Node().TCP() > 0 { - err := ioutil.WriteFile(EnodeAddressFileName, []byte(srv.localnode.Node().URLv4()), 0600) - if err != nil { - srv.log.Error("Write enode to file failed", "self", srv.localnode.Node().URLv4()) - } - } if len(srv.Config.Protocols) > 0 { srv.log.Info("Started P2P networking", "version", srv.Config.Protocols[0].Version, "self", srv.localnode.Node().URLv4(), "name", srv.Name) }