From c7aed335ceecc7fbbcb03ee7c6d17853fa66af38 Mon Sep 17 00:00:00 2001 From: Robert Habermeier Date: Wed, 17 Jan 2018 09:45:36 +0100 Subject: [PATCH] update back-references more aggressively after answering from cache (#7578) --- ethcore/light/src/on_demand/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ethcore/light/src/on_demand/mod.rs b/ethcore/light/src/on_demand/mod.rs index c7d2a01e1..64c1420a1 100644 --- a/ethcore/light/src/on_demand/mod.rs +++ b/ethcore/light/src/on_demand/mod.rs @@ -90,7 +90,14 @@ impl Pending { match self.requests[idx].respond_local(cache) { Some(response) => { self.requests.supply_response_unchecked(&response); + + // update header and back-references after each from-cache + // response to ensure that the requests are left in a consistent + // state and increase the likelihood of being able to answer + // the next request from cache. self.update_header_refs(idx, &response); + self.fill_unanswered(); + self.responses.push(response); } None => break,