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.
This commit is contained in:
Callum Waters
2020-01-30 08:21:17 +01:00
committed by GitHub
parent 8b80de830f
commit 71d50f7ab5
+5
View File
@@ -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
}
}