Browse Source

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.
pull/4359/head
Callum Waters 5 years ago
committed by GitHub
parent
commit
71d50f7ab5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      lite2/client.go

+ 5
- 0
lite2/client.go 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
}
}


Loading…
Cancel
Save