Skip to content

Commit

Permalink
Adding the validate_bip30_block_hash to chain_state file
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerson2102 committed Sep 18, 2024
1 parent 4b86ef2 commit 1729bc6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/consensus/src/types/chain_state.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ use core::fmt::{Display, Formatter, Error};
use crate::validation::{
difficulty::{validate_bits, adjust_difficulty}, coinbase::validate_coinbase,
timestamp::{validate_timestamp, next_prev_timestamps},
work::{validate_proof_of_work, compute_total_work}, block::{compute_and_validate_tx_data},
work::{validate_proof_of_work, compute_total_work},
block::{compute_and_validate_tx_data, validate_bip30_block_hash},
};
use super::block::{BlockHash, Block, TransactionData};
use super::utxo_set::UtxoSet;
Expand Down Expand Up @@ -88,6 +89,7 @@ pub impl BlockValidatorImpl of BlockValidator {

validate_proof_of_work(current_target, best_block_hash)?;
validate_bits(current_target, block.header.bits)?;
validate_bip30_block_hash(block_height, @best_block_hash)?;

Result::Ok(
ChainState {
Expand Down

0 comments on commit 1729bc6

Please sign in to comment.