mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-28 20:21:47 +00:00
preserve original address and dial it instead of self-reported address (#1994)
Refs #1720
This commit is contained in:
@ -8,8 +8,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/tendermint/tendermint/config"
|
||||
"github.com/tendermint/tendermint/p2p/conn"
|
||||
cmn "github.com/tendermint/tendermint/libs/common"
|
||||
"github.com/tendermint/tendermint/p2p/conn"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -281,8 +281,11 @@ func (sw *Switch) StopPeerForError(peer Peer, reason interface{}) {
|
||||
sw.stopAndRemovePeer(peer, reason)
|
||||
|
||||
if peer.IsPersistent() {
|
||||
// NOTE: this is the self-reported addr, not the original we dialed
|
||||
go sw.reconnectToPeer(peer.NodeInfo().NetAddress())
|
||||
addr := peer.OriginalAddr()
|
||||
if addr == nil {
|
||||
panic(fmt.Sprintf("persistent peer %v with no original address", peer))
|
||||
}
|
||||
go sw.reconnectToPeer(addr)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user