Skip to content

Commit

Permalink
Fixed review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
shawn-zil committed Oct 7, 2024
1 parent d601ff9 commit 6482fce
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions zilliqa/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2635,10 +2635,11 @@ impl Consensus {
for (idx, tx_hash) in block.transactions.iter().enumerate() {
// Prefer to insert verified txn from pool. This is faster.
let txn = match self.transaction_pool.pop_transaction(*tx_hash) {
Some(txn) if txn.hash == *tx_hash => txn,
Some(txn) => txn,
_ => match transactions
.get(idx)
.and_then(|sig_tx| sig_tx.clone().verify().ok())
.map(|sig_tx| sig_tx.clone().verify())
.transpose()?
{
// Otherwise, recover txn from proposal. This is slower.
Some(txn) if txn.hash == *tx_hash => txn,
Expand All @@ -2648,7 +2649,7 @@ impl Consensus {
}
},
};
verified_txns.insert(idx, txn);
verified_txns.push(txn);
}

let transaction_hashes = verified_txns
Expand Down

0 comments on commit 6482fce

Please sign in to comment.