Fix mining.
This commit is contained in:
parent
e214489106
commit
e6136eb075
@ -197,6 +197,8 @@ impl<C, S, A, M, EM> EthClient<C, S, A, M, EM>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const MAX_QUEUE_SIZE_TO_MINE_ON: usize = 4; // because uncles go back 6.
|
||||||
|
|
||||||
impl<C, S, A, M, EM> Eth for EthClient<C, S, A, M, EM>
|
impl<C, S, A, M, EM> Eth for EthClient<C, S, A, M, EM>
|
||||||
where C: BlockChainClient + 'static,
|
where C: BlockChainClient + 'static,
|
||||||
S: SyncProvider + 'static,
|
S: SyncProvider + 'static,
|
||||||
@ -401,7 +403,7 @@ impl<C, S, A, M, EM> Eth for EthClient<C, S, A, M, EM>
|
|||||||
// check if we're still syncing and return empty strings in that case
|
// check if we're still syncing and return empty strings in that case
|
||||||
{
|
{
|
||||||
let sync = take_weak!(self.sync);
|
let sync = take_weak!(self.sync);
|
||||||
if sync.status().state != SyncState::Idle && client.queue_info().is_empty() {
|
if sync.status().state != SyncState::Idle && !client.queue_info().total_queue_size() > MAX_QUEUE_SIZE_TO_MINE_ON {
|
||||||
trace!(target: "miner", "Syncing. Cannot give any work.");
|
trace!(target: "miner", "Syncing. Cannot give any work.");
|
||||||
return to_value(&(String::new(), String::new(), String::new()));
|
return to_value(&(String::new(), String::new(), String::new()));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user