From 46ed483b5de7f83ddf76fe235f11620ea9e3a1b8 Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Tue, 25 Sep 2018 18:39:00 +0200 Subject: [PATCH] fix(light_fetch): avoid race with BlockNumber::Latest --- rpc/src/v1/helpers/light_fetch.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpc/src/v1/helpers/light_fetch.rs b/rpc/src/v1/helpers/light_fetch.rs index 88821c572f0..ade100baa5a 100644 --- a/rpc/src/v1/helpers/light_fetch.rs +++ b/rpc/src/v1/helpers/light_fetch.rs @@ -250,7 +250,8 @@ impl LightFetch { }).join(header_fut).and_then(move |((gas_known, tx), hdr)| { // then request proved execution. // TODO: get last-hashes from network. - let env_info = match client.env_info(id) { + let hash = hdr.hash(); + let env_info = match client.env_info(BlockId::Hash(hash)) { Some(env_info) => env_info, _ => return Either::A(future::err(errors::unknown_block())), };