mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-23 01:41:31 +00:00
p2p: make persistent prop independent of conn direction (#3593)
## Description Previously only outbound peers can be persistent. Now, even if the peer is inbound, if it's marked as persistent, when/if conn is lost, Tendermint will try to reconnect. This part is actually optional and can be reverted. Plus, seed won't disconnect from inbound peer if it's marked as persistent. Fixes #3362 ## Commits * make persistent prop independent of conn direction Previously only outbound peers can be persistent. Now, even if the peer is inbound, if it's marked as persistent, when/if conn is lost, Tendermint will try to reconnect. Plus, seed won't disconnect from inbound peer if it's marked as persistent. Fixes #3362 * fix TestPEXReactorDialPeer test * add a changelog entry * update changelog * add two tests * reformat code * test UnsafeDialPeers and UnsafeDialSeeds * add TestSwitchDialPeersAsync * spec: update p2p/config spec * fixes after Ismail's review * Apply suggestions from code review Co-Authored-By: melekes <anton.kalyaev@gmail.com> * fix merge conflict * remove sleep from TestPEXReactorDoesNotDisconnectFromPersistentPeerInSeedMode We don't need it actually.
This commit is contained in:
@ -44,7 +44,8 @@ type transport interface {
|
||||
}
|
||||
|
||||
type peers interface {
|
||||
DialPeersAsync(p2p.AddrBook, []string, bool) error
|
||||
AddPersistentPeers([]string) error
|
||||
DialPeersAsync([]string) error
|
||||
NumPeers() (outbound, inbound, dialig int)
|
||||
Peers() p2p.IPeerSet
|
||||
}
|
||||
|
Reference in New Issue
Block a user