aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'p2p/server.go')
-rw-r--r--p2p/server.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/p2p/server.go b/p2p/server.go
index 326781234..cfff442f7 100644
--- a/p2p/server.go
+++ b/p2p/server.go
@@ -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)
}
}
@@ -258,6 +260,7 @@ func (srv *Server) listenLoop() {
for {
select {
case slot := <-srv.peerSlots:
+ srvlog.Debugf("grabbed slot %v for listening", slot)
conn, err := srv.listener.Accept()
if err != nil {
srv.peerSlots <- slot
@@ -330,6 +333,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