From c20e76105122a4ac5c8095f070b9bf06d5702b30 Mon Sep 17 00:00:00 2001 From: Nikolay Volf Date: Tue, 15 Mar 2016 17:13:44 +0100 Subject: [PATCH] adding check for a sync --- rpc/src/v1/impls/eth.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/rpc/src/v1/impls/eth.rs b/rpc/src/v1/impls/eth.rs index fda391304..66339241e 100644 --- a/rpc/src/v1/impls/eth.rs +++ b/rpc/src/v1/impls/eth.rs @@ -321,6 +321,14 @@ impl Eth for EthClient fn work(&self, params: Params) -> Result { match params { Params::None => { + // check if we a still syncing and return empty strings int that case + { + let sync = take_weak!(self.sync); + if sync.status().state != SyncState::Idle { + return to_value(&(String::new(), String::new(), String::new())); + } + } + let miner = take_weak!(self.miner); let client = take_weak!(self.client); let u = miner.sealing_block(client.deref()).lock().unwrap();