From cb54152c2356e95c10cc8cae8cd3b7b99f3e005a Mon Sep 17 00:00:00 2001 From: Robert Habermeier Date: Tue, 15 Nov 2016 15:47:08 +0100 Subject: [PATCH] cut off headers after first missing --- ethcore/src/client/client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index 1054f0614..58c8f4df6 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -1349,8 +1349,8 @@ impl light::Provider for Client { .take_while(|x| if req.reverse { x < &start_num } else { best_num - start_num < *x }) .map(|x| if req.reverse { start_num - x } else { start_num + x }) .map(|x| self.block_header(BlockID::Number(x))) + .take_while(|x| x.is_some()) .flat_map(|x| x) - .fuse() // collect no more beyond the first `None` .collect() }