From 71d50f7ab5c27beb1a8d36d89343ce66ec57ac3d Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Thu, 30 Jan 2020 08:21:17 +0100 Subject: [PATCH] lite2: panic if witness is on another chain (#4356) Closes #4350 Checks that the chain ID of the witness and that of the lite client are the same before updating the witness list. --- lite2/client.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lite2/client.go b/lite2/client.go index 446e272f7..4d49c9cac 100644 --- a/lite2/client.go +++ b/lite2/client.go @@ -89,6 +89,11 @@ func SkippingVerification(trustLevel tmmath.Fraction) Option { // current primary is unavailable. func Witnesses(providers []provider.Provider) Option { return func(c *Client) { + for _, witness := range providers { + if witness.ChainID() != c.ChainID() { + panic("Witness chainID is not equal to the Lite Client chainID") + } + } c.witnesses = providers } }