pub fn validate(&self) -> Result<(), SPVError> {
        if self.hash != self.raw.digest() {
            return Err(SPVError::WrongDigest);
        }
        if self.merkle_root != self.raw.tx_root() {
            return Err(SPVError::WrongMerkleRoot);
        }
        if self.prevhash != self.raw.parent() {
            return Err(SPVError::WrongPrevHash);
        }
        Ok(())
    }
/// Checks validity of an entire Bitcoin header
///
/// # Arguments
///
/// * `self` - The Bitcoin header
///
/// # Errors
///
/// * Errors if any of the Bitcoin header elements are invalid.
Checks validity of an entire Bitcoin header
Checks validity of an entire Bitcoin header
pub fn validate(&self) -> Result<(), SPVError> {
        if self.hash != self.raw.digest() {
            return Err(SPVError::WrongDigest);
        }
        if self.merkle_root != self.raw.tx_root() {
            return Err(SPVError::WrongMerkleRoot);
        }
        if self.prevhash != self.raw.parent() {
            return Err(SPVError::WrongPrevHash);
        }
        Ok(())
    }
pub fn validate ( & self ) -> Result < ( ) , SPVError > { if self . hash != self . raw . digest ( ) { return Err ( SPVError :: WrongDigest ) ; } if self . merkle_root != self . raw . tx_root ( ) { return Err ( SPVError :: WrongMerkleRoot ) ; } if self . prevhash != self . raw . parent ( ) { return Err ( SPVError :: WrongPrevHash ) ; } Ok ( ( ) ) }
Checks validity of an entire Bitcoin header
Checks validity of an entire Bitcoin header
&self
&self
errors
Errors if any of the Bitcoin header elements are invalid.
Errors if any of the Bitcoin header elements are invalid .