mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 04:36:42 +00:00
add some logging to server dialout and ignored peer suggestion
This commit is contained in:
parent
53aa639c51
commit
b39aaa0441
1 changed files with 4 additions and 1 deletions
|
|
@ -113,9 +113,11 @@ func (srv *Server) PeerCount() int {
|
|||
|
||||
// SuggestPeer injects an address into the outbound address pool.
|
||||
func (srv *Server) SuggestPeer(ip net.IP, port int, nodeID []byte) {
|
||||
addr := &peerAddr{ip, uint64(port), nodeID}
|
||||
select {
|
||||
case srv.peerConnect <- &peerAddr{ip, uint64(port), nodeID}:
|
||||
case srv.peerConnect <- addr:
|
||||
default: // don't block
|
||||
srvlog.Warnf("peer suggestion %v ignored", addr)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -330,6 +332,7 @@ func (srv *Server) dialLoop() {
|
|||
case desc := <-suggest:
|
||||
// candidate peer found, will dial out asyncronously
|
||||
// if connection fails slot will be released
|
||||
srvlog.Infof("dial %v (%v)", desc, *slot)
|
||||
go srv.dialPeer(desc, *slot)
|
||||
// we can watch if more peers needed in the next loop
|
||||
slots = srv.peerSlots
|
||||
|
|
|
|||
Loading…
Reference in a new issue