Skip to content

Commit

Permalink
fix: skip coinbase (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejka authored Nov 5, 2024
1 parent 7e0867a commit bf4b89d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/consensus/src/types/chain_state.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub impl BlockValidatorImpl of BlockValidator {
)?;
validate_coinbase(txs[0], total_fees, block_height, wtxid_root)?;
if execute_script {
validate_scripts(@block.header, txs)?;
validate_scripts(@block.header, txs.slice(1, txs.len() - 1))?;
}
txid_root
}
Expand Down
2 changes: 1 addition & 1 deletion packages/consensus/src/validation/script.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ fn validate_script(header: @Header, tx: @Transaction, tx_idx: u32) -> Result<(),

pub fn validate_scripts(header: @Header, txs: Span<Transaction>) -> Result<(), ByteArray> {
let mut r = Result::Ok(());
let mut i = 0;
let mut i = 1;
for tx in txs {
r = validate_script(header, tx, i);
if r.is_err() {
Expand Down

0 comments on commit bf4b89d

Please sign in to comment.