From 2d44b3ebeac364436a36ae9af2f771383e86e7ad Mon Sep 17 00:00:00 2001 From: Andronik Ordian Date: Sat, 29 Sep 2018 22:22:36 +0200 Subject: [PATCH] fix(light_fetch): avoid race with BlockNumber::Latest (#9665) --- 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 88821c572..ade100baa 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())), };