babe: exponential backoff on missed blocks (#4397)

* fix srml-support compilation

* babe: exponential backoff on missed blocks.
This commit is contained in:
Robert Habermeier
2019-12-15 17:24:49 +01:00
committed by Gavin Wood
parent 0ece5d9e17
commit 16047e30bf
2 changed files with 21 additions and 6 deletions
+4 -2
View File
@@ -364,8 +364,10 @@ impl<Value: Decode> Iterator for PrefixIterator<Value> {
type Item = Value;
fn next(&mut self) -> Option<Self::Item> {
match sp_io::storage::next_key(&self.previous_key) {
Some(next_key) if next_key.starts_with(&self.prefix[..]) => {
match sp_io::storage::next_key(&self.previous_key)
.filter(|n| n.starts_with(&self.prefix[..]))
{
Some(next_key) => {
let value = unhashed::get(&next_key);
if value.is_none() {