Skip to content

Commit

Permalink
Skip own enode in static-nodes.json
Browse files Browse the repository at this point in the history
  • Loading branch information
wizeguyy authored and gameofpointers committed Sep 22, 2023
1 parent fea9ce1 commit 597e46b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion p2p/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
}

Expand Down

0 comments on commit 597e46b

Please sign in to comment.