Browse Source

p2p: log as debug msg when address dialing is already connected (#4082)

Fixes #3991
pull/4084/head
Hongmin 5 years ago
committed by Anton Kaliaev
parent
commit
2f8ba80689
2 changed files with 6 additions and 3 deletions
  1. +1
    -0
      CHANGELOG_PENDING.md
  2. +5
    -3
      p2p/pex/pex_reactor.go

+ 1
- 0
CHANGELOG_PENDING.md View File

@ -22,6 +22,7 @@ program](https://hackerone.com/tendermint).
- [mempool] [\#4057](https://github.com/tendermint/tendermint/issues/4057) Include peer ID when logging rejected txns (@erikgrinaker)
- [tools] [\#4023](https://github.com/tendermint/tendermint/issues/4023) Improved `tm-monitor` formatting of start time and avg tx throughput (@erikgrinaker)
- [p2p] [\#3991](https://github.com/tendermint/tendermint/issues/3991) Log "has been established or dialed" as debug log instead of Error for connected peers (@whunmr)
### BUG FIXES:


+ 5
- 3
p2p/pex/pex_reactor.go View File

@ -368,7 +368,7 @@ func (r *PEXReactor) ReceiveAddrs(addrs []*p2p.NetAddress, src Peer) error {
err := r.dialPeer(addr)
if err != nil {
switch err.(type) {
case errMaxAttemptsToDial, errTooEarlyToDial:
case errMaxAttemptsToDial, errTooEarlyToDial, p2p.ErrCurrentlyDialingOrExistingAddress:
r.Logger.Debug(err.Error(), "addr", addr)
default:
r.Logger.Error(err.Error(), "addr", addr)
@ -590,7 +590,9 @@ func (r *PEXReactor) dialSeeds() {
// dial a random seed
seedAddr := r.seedAddrs[i]
err := r.Switch.DialPeerWithAddress(seedAddr)
if err == nil {
switch err.(type) {
case nil, p2p.ErrCurrentlyDialingOrExistingAddress:
return
}
r.Switch.Logger.Error("Error dialing seed", "err", err, "seed", seedAddr)
@ -676,7 +678,7 @@ func (r *PEXReactor) crawlPeers(addrs []*p2p.NetAddress) {
err := r.dialPeer(addr)
if err != nil {
switch err.(type) {
case errMaxAttemptsToDial, errTooEarlyToDial:
case errMaxAttemptsToDial, errTooEarlyToDial, p2p.ErrCurrentlyDialingOrExistingAddress:
r.Logger.Debug(err.Error(), "addr", addr)
default:
r.Logger.Error(err.Error(), "addr", addr)


Loading…
Cancel
Save