fix(light_fetch): avoid race with BlockNumber::Latest (#9665)

This commit is contained in:
Andronik Ordian 2018-09-29 22:22:36 +02:00 committed by Afri Schoedon
parent 984493db30
commit 2d44b3ebea

View File

@ -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())),
};