From 597e46b203764cdfd09b56a1630fdf95f299bba4 Mon Sep 17 00:00:00 2001 From: wizeguyy Date: Thu, 21 Sep 2023 16:40:03 -0500 Subject: [PATCH] Skip own enode in static-nodes.json --- p2p/server.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/p2p/server.go b/p2p/server.go index b90cb98782..11432b7e4d 100644 --- a/p2p/server.go +++ b/p2p/server.go @@ -632,7 +632,12 @@ func (srv *Server) setupDialScheduler() { } srv.dialsched = newDialScheduler(config, srv.discmix, srv.SetupConn) for _, n := range srv.StaticNodes { - srv.dialsched.addStatic(n) + // If our own enode is in the StaticNodes list, skip it + if !srv.localnode.Node().Pubkey().Equal(n.Pubkey()) { + srv.dialsched.addStatic(n) + } else { + log.Info("Found the current Node in the static node list", "PubKey", n.Pubkey()) + } } }