staking miner: remove needless queue check (#6221)

* staking miner: remove needless queue check

If the queue is full and the "mined solution" is better than solutions in the queue according to the "strategy"
then the solution with worse score will be kicked out from the queue.

Thus, the check can be removed completly.

* fix compile warns
This commit is contained in:
Niklas Adolfsson authored and GitHub committed 2022-11-08 16:19:48 +00:00
1 parent 63c6f184cb
commit e1ccb8499d
2 files changed
+2 -4

No files matched your search

-1
View File
@@ -253,7 +253,6 @@ enum Error<T: EPM::Config> {
AlreadySubmitted,
VersionMismatch,
StrategyNotSatisfied,
QueueFull,
Other(String),
}
+2 -3
View File
@@ -120,9 +120,8 @@ async fn ensure_strategy_met<T: EPM::Config, B: BlockT>(
.map_err::<Error<T>, _>(Into::into)?
.unwrap_or_default();
// we check the queue here as well. Could be checked elsewhere.
if indices.len() as u32 >= max_submissions {
return Err(Error::<T>::QueueFull)
if indices.len() >= max_submissions as usize {
log::debug!(target: LOG_TARGET, "The submissions queue is full");
}
// default score is all zeros, any score is better than it.