mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-09 22:47:24 +00:00
e2e: prevent adding light clients as persistent peers (#6743)
This commit is contained in:
@@ -223,16 +223,22 @@ func LoadTestnet(file string) (*Testnet, error) {
|
||||
if peer == nil {
|
||||
return nil, fmt.Errorf("unknown persistent peer %q for node %q", peerName, node.Name)
|
||||
}
|
||||
if peer.Mode == ModeLight {
|
||||
return nil, fmt.Errorf("can not have a light client as a persistent peer (for %q)", node.Name)
|
||||
}
|
||||
node.PersistentPeers = append(node.PersistentPeers, peer)
|
||||
}
|
||||
|
||||
// If there are no seeds or persistent peers specified, default to persistent
|
||||
// connections to all other nodes.
|
||||
// connections to all other full nodes.
|
||||
if len(node.PersistentPeers) == 0 && len(node.Seeds) == 0 {
|
||||
for _, peer := range testnet.Nodes {
|
||||
if peer.Name == node.Name {
|
||||
continue
|
||||
}
|
||||
if peer.Mode == ModeLight {
|
||||
continue
|
||||
}
|
||||
node.PersistentPeers = append(node.PersistentPeers, peer)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user