Browse Source

e2e: prevent adding light clients as persistent peers (#6743)

pull/6747/head
Callum Waters 3 years ago
committed by GitHub
parent
commit
2abfe20114
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      test/e2e/pkg/testnet.go

+ 7
- 1
test/e2e/pkg/testnet.go View File

@ -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)
}
}


Loading…
Cancel
Save