preserve dial to itself

This commit is contained in:
Mehmet Gurevin
2018-11-08 18:01:58 +03:00
parent 02ad2f0630
commit 0c6e0fc58d

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