check vote costs against block limits in would_fit (#34207)

This commit is contained in:
Andrew Fitzgerald 2023-11-22 13:19:13 -08:00 committed by GitHub
parent 53c723ae3f
commit 6d703edd2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -186,7 +186,9 @@ impl CostTracker {
if self.vote_cost.saturating_add(cost) > self.vote_cost_limit {
return Err(CostTrackerError::WouldExceedVoteMaxLimit);
}
} else if self.block_cost.saturating_add(cost) > self.block_cost_limit {
}
if self.block_cost.saturating_add(cost) > self.block_cost_limit {
// check against the total package cost
return Err(CostTrackerError::WouldExceedBlockMaxLimit);
}