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 committed Sep 21, 2023
1 parent fea9ce1 commit 44afa24
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion p2p/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,10 @@ 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 int he StaticNodes list, skip it
if !srv.localnode.Node().Pubkey().Equal(n.Pubkey()) {
srv.dialsched.addStatic(n)
}
}
}

Expand Down

0 comments on commit 44afa24

Please sign in to comment.