check vote costs against block limits in would_fit (#34207)
This commit is contained in:
parent
53c723ae3f
commit
6d703edd2e
|
@ -186,7 +186,9 @@ impl CostTracker {
|
||||||
if self.vote_cost.saturating_add(cost) > self.vote_cost_limit {
|
if self.vote_cost.saturating_add(cost) > self.vote_cost_limit {
|
||||||
return Err(CostTrackerError::WouldExceedVoteMaxLimit);
|
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
|
// check against the total package cost
|
||||||
return Err(CostTrackerError::WouldExceedBlockMaxLimit);
|
return Err(CostTrackerError::WouldExceedBlockMaxLimit);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue