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

Commit

Permalink
fix(light_fetch): avoid race with BlockNumber::Latest (#9665)
Browse files Browse the repository at this point in the history
  • Loading branch information
ordian authored and 5chdn committed Sep 29, 2018
1 parent 984493d commit 2d44b3e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rpc/src/v1/helpers/light_fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())),
};
Expand Down

0 comments on commit 2d44b3e

Please sign in to comment.