mirror of
https://github.com/tendermint/tendermint.git
synced 2026-07-20 06:52:30 +00:00
show listener external address in log
This commit is contained in:
@@ -76,6 +76,7 @@ func (n *Node) initPeer(peer *p2p.Peer) {
|
||||
|
||||
// Add a Listener to accept incoming peer connections.
|
||||
func (n *Node) AddListener(l p2p.Listener) {
|
||||
log.Infof("Adding listener %v", l)
|
||||
go func() {
|
||||
for {
|
||||
inConn, ok := <-l.Connections()
|
||||
@@ -109,7 +110,7 @@ func (n *Node) ensurePeers() {
|
||||
for j := 0; i < 3; j++ {
|
||||
picked = n.book.PickAddress(newBias)
|
||||
if picked == nil {
|
||||
log.Infof("Empty addrbook.")
|
||||
log.Debug("Empty addrbook.")
|
||||
return
|
||||
}
|
||||
if n.sw.Peers().Has(picked) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package p2p
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"strconv"
|
||||
"sync/atomic"
|
||||
@@ -113,6 +114,10 @@ func (l *DefaultListener) Stop() {
|
||||
}
|
||||
}
|
||||
|
||||
func (l *DefaultListener) String() string {
|
||||
return fmt.Sprintf("Listener(@%v)", l.extAddr)
|
||||
}
|
||||
|
||||
/* external address helpers */
|
||||
|
||||
// UPNP external address discovery & port mapping
|
||||
|
||||
Reference in New Issue
Block a user