Browse Source

preserve dial to itself

pull/2664/head
Mehmet Gurevin 6 years ago
parent
commit
0c6e0fc58d
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      p2p/pex/pex_reactor.go

+ 4
- 1
p2p/pex/pex_reactor.go View File

@ -8,7 +8,6 @@ import (
"time"
"github.com/pkg/errors"
amino "github.com/tendermint/go-amino"
cmn "github.com/tendermint/tendermint/libs/common"
"github.com/tendermint/tendermint/p2p"
@ -411,6 +410,10 @@ func (r *PEXReactor) ensurePeers() {
if r.Switch.IsDialingOrExistingAddress(try) {
continue
}
if r.Switch.NodeInfo().ID() == try.ID {
continue // we don't want to dial ourselves, usually.
}
// TODO: consider moving some checks from toDial into here
// so we don't even consider dialing peers that we want to wait
// before dialling again, or have dialed too many times already


Loading…
Cancel
Save