pub fn compare_new_header_with_witness(
    new_header: &SignedHeader,
    witness: &mut Provider,
    max_clock_drift: Duration,
    max_block_lag: Duration
) -> Result<(), CompareError>
Expand description

Takes the verified header from the primary and compares it with a header from a specified witness. The function can return one of three errors:

1: CompareError::ConflictingHeaders: there may have been an attack on this light client 2: CompareError::BadWitness: the witness has either not responded, doesn’t have the header or has given us an invalid one 3: CompareError::Other: some other error has occurred, this is likely a benign error

Note: In the case of an invalid header we remove the witness

3: nil -> the hashes of the two headers match