Skip to content

Commit

Permalink
Fix a bug in pull proofs method
Browse files Browse the repository at this point in the history
  • Loading branch information
vusirikala committed Jun 15, 2024
1 parent 5530a29 commit 23567bc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions consensus/src/quorum_store/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,15 @@ impl ProofQueue {
} else if let Some(Some((proof, insertion_time))) =
self.batch_to_proof.get(&sort_key.batch_key)
{
cur_bytes += batch.num_bytes();
cur_txns += batch.num_txns();
if cur_bytes > max_bytes || cur_txns > max_txns {
if cur_bytes + batch.num_bytes() > max_bytes
|| cur_txns + batch.num_txns() > max_txns
{
// Exceeded the limit for requested bytes or number of transactions.
full = true;
return false;
}
cur_bytes += batch.num_bytes();
cur_txns += batch.num_txns();
let bucket = proof.gas_bucket_start();
ret.push(proof.clone());
counters::pos_to_pull(bucket, insertion_time.elapsed().as_secs_f64());
Expand Down

0 comments on commit 23567bc

Please sign in to comment.