* Check if synced when using eth_getWork (#9193) * Don't use fn syncing * Fix identation * Fix typo * Don't check for warping * rpc: avoid calling queue_info twice on eth_getWork
This commit is contained in:
parent
10f42a2b39
commit
f0c0da8551
@ -744,9 +744,11 @@ impl<C, SN: ?Sized, S: ?Sized, M, EM, T: StateInfo + 'static> Eth for EthClient<
|
|||||||
|
|
||||||
// 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
|
||||||
{
|
{
|
||||||
//TODO: check if initial sync is complete here
|
let sync_status = self.sync.status();
|
||||||
//let sync = self.sync;
|
let queue_info = self.client.queue_info();
|
||||||
if /*sync.status().state != SyncState::Idle ||*/ self.client.queue_info().total_queue_size() > MAX_QUEUE_SIZE_TO_MINE_ON {
|
let total_queue_size = queue_info.total_queue_size();
|
||||||
|
|
||||||
|
if is_major_importing(Some(sync_status.state), 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 Err(errors::no_work());
|
return Err(errors::no_work());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user