Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Check if synced when using eth_getWork (#9193) #9210

Merged
merged 6 commits into from
Jul 31, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions rpc/src/v1/impls/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -744,9 +744,8 @@ 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
{
//TODO: check if initial sync is complete here
//let sync = self.sync;
if /*sync.status().state != SyncState::Idle ||*/ self.client.queue_info().total_queue_size() > MAX_QUEUE_SIZE_TO_MINE_ON {
let sync = self.syncing();
if sync != Ok(SyncStatus::None) || self.client.queue_info().total_queue_size() > MAX_QUEUE_SIZE_TO_MINE_ON {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use is_major_importing here instead like it's done in fn syncing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the reivew @andresilva. I updated my PR so that it uses is_major_importing.

trace!(target: "miner", "Syncing. Cannot give any work.");
return Err(errors::no_work());
}
Expand Down