From 2abfe20114ee3bb3adfee817589033529a804e4d Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Tue, 20 Jul 2021 20:11:43 +0200 Subject: [PATCH] e2e: prevent adding light clients as persistent peers (#6743) --- test/e2e/pkg/testnet.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/e2e/pkg/testnet.go b/test/e2e/pkg/testnet.go index ac22631f5..a5cec0147 100644 --- a/test/e2e/pkg/testnet.go +++ b/test/e2e/pkg/testnet.go @@ -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) } }