fn validate_merkle_root(&self, tree: MmrTree, height: u64) -> Result<bool, ChainStorageError> {
        let header: BlockHeader = lmdb_get(&self.env, &self.headers_db, &height)?.ok_or_else(|| {
            ChainStorageError::InvalidQuery(format!(
                "Header at height {} was not found when validating {} merkle root",
                height, tree
            ))
        })?;

        match tree {
            MmrTree::Utxo => validate_merkle_root(&self.utxo_mmr, &self.curr_utxo_checkpoint, &header.output_mr),
            MmrTree::Kernel => validate_merkle_root(&self.kernel_mmr, &self.curr_kernel_checkpoint, &header.kernel_mr),
            MmrTree::RangeProof => validate_merkle_root(
                &self.range_proof_mmr,
                &self.curr_range_proof_checkpoint,
                &header.range_proof_mr,
            ),
        }
    }
/// Validate the MMR root for the given `MmrTree` matches the header at the given height
Validate the MMR root for the given `MmrTree` matches the header at the given height
Validate the MMR root for the given ` MmrTree ` matches the header at the given height
fn validate_merkle_root(&self, tree: MmrTree, height: u64) -> Result<bool, ChainStorageError> {
        let header: BlockHeader = lmdb_get(&self.env, &self.headers_db, &height)?.ok_or_else(|| {
            ChainStorageError::InvalidQuery(format!(
                "Header at height {} was not found when validating {} merkle root",
                height, tree
            ))
        })?;
        match tree {
            MmrTree::Utxo => validate_merkle_root(&self.utxo_mmr, &self.curr_utxo_checkpoint, &header.output_mr),
            MmrTree::Kernel => validate_merkle_root(&self.kernel_mmr, &self.curr_kernel_checkpoint, &header.kernel_mr),
            MmrTree::RangeProof => validate_merkle_root(
                &self.range_proof_mmr,
                &self.curr_range_proof_checkpoint,
                &header.range_proof_mr,
            ),
        }
    }
fn validate_merkle_root ( & self , tree : MmrTree , height : u64 ) -> Result < bool , ChainStorageError > { let header : BlockHeader = lmdb_get ( & self . env , & self . headers_db , & height ) ? . ok_or_else ( | | { ChainStorageError :: InvalidQuery ( format ! ( " " height tree ) ) } ) ? ; match tree { MmrTree :: Utxo => validate_merkle_root ( & self . utxo_mmr , & self . curr_utxo_checkpoint , & header . output_mr ) , MmrTree :: Kernel => validate_merkle_root ( & self . kernel_mmr , & self . curr_kernel_checkpoint , & header . kernel_mr ) , MmrTree :: RangeProof => validate_merkle_root ( & self . range_proof_mmr , & self . curr_range_proof_checkpoint , & header . range_proof_mr , ) , } }
Validate the MMR root for the given `MmrTree` matches the header at the given height
Validate the MMR root for the given ` MmrTree ` matches the header at the given height
&self
tree
MmrTree
height
u64
&self
tree
MmrTree
height
u64