p2p: enforce connection retry limit on server side (#19684)
The dialer limits itself to one attempt every 30s. Apply the same limit in Server and reject peers which try to connect too eagerly. The check against the limit happens right after accepting the connection. Further changes in this commit ensure we pass the Server logger down to Peer instances, discovery and dialState. Unit test logging now works in all Server tests.
Showing
- p2p/dial.go 26 additions, 81 deletionsp2p/dial.go
- p2p/dial_test.go 69 additions, 91 deletionsp2p/dial_test.go
- p2p/netutil/addrutil.go 33 additions, 0 deletionsp2p/netutil/addrutil.go
- p2p/peer.go 2 additions, 2 deletionsp2p/peer.go
- p2p/peer_test.go 3 additions, 1 deletionp2p/peer_test.go
- p2p/server.go 112 additions, 88 deletionsp2p/server.go
- p2p/server_test.go 139 additions, 31 deletionsp2p/server_test.go
- p2p/util.go 82 additions, 0 deletionsp2p/util.go
- p2p/util_test.go 54 additions, 0 deletionsp2p/util_test.go
Loading
Please register or sign in to comment