mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-12 12:51:22 +00:00
p2p: NodeInfo is an interface; General cleanup (#2556)
* p2p: NodeInfo is an interface * (squash) fixes from review * (squash) more fixes from review * p2p: remove peerConn.HandshakeTimeout * p2p: NodeInfo is two interfaces. Remove String() * fixes from review * remove test code from peer.RemoteIP() * p2p: remove peer.OriginalAddr(). See #2618 * use a mockPeer in peer_set_test.go * p2p: fix testNodeInfo naming * p2p: remove unused var * remove testRandNodeInfo * fix linter * fix retry dialing self * fix rpc
This commit is contained in:
@ -280,12 +280,9 @@ func (sw *Switch) StopPeerForError(peer Peer, reason interface{}) {
|
||||
sw.stopAndRemovePeer(peer, reason)
|
||||
|
||||
if peer.IsPersistent() {
|
||||
addr := peer.OriginalAddr()
|
||||
if addr == nil {
|
||||
// FIXME: persistent peers can't be inbound right now.
|
||||
// self-reported address for inbound persistent peers
|
||||
addr = peer.NodeInfo().NetAddress()
|
||||
}
|
||||
// TODO: use the original address dialed, not the self reported one
|
||||
// See #2618.
|
||||
addr := peer.NodeInfo().NetAddress()
|
||||
go sw.reconnectToPeer(addr)
|
||||
}
|
||||
}
|
||||
@ -560,9 +557,13 @@ func (sw *Switch) addOutboundPeerWithConfig(
|
||||
// to avoid dialing in the future.
|
||||
sw.addrBook.RemoveAddress(addr)
|
||||
sw.addrBook.AddOurAddress(addr)
|
||||
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// retry persistent peers after
|
||||
// any dial error besides IsSelf()
|
||||
if persistent {
|
||||
go sw.reconnectToPeer(addr)
|
||||
}
|
||||
|
Reference in New Issue
Block a user