Remove panickers from trie iterators (#2209)
* port trie iterators to use error handling * use new trie iterators in snapshot allows proper recovery from a premature periodic snapshot
This commit is contained in:
committed by
Gav Wood
parent
8c111da70b
commit
a100b9d09e
@@ -52,8 +52,9 @@ impl StateProducer {
|
||||
// modify existing accounts.
|
||||
let mut accounts_to_modify: Vec<_> = {
|
||||
let trie = TrieDB::new(&*db, &self.state_root).unwrap();
|
||||
let temp = trie.iter() // binding required due to complicated lifetime stuff
|
||||
let temp = trie.iter().unwrap() // binding required due to complicated lifetime stuff
|
||||
.filter(|_| rng.gen::<f32>() < ACCOUNT_CHURN)
|
||||
.map(Result::unwrap)
|
||||
.map(|(k, v)| (H256::from_slice(&k), v.to_owned()))
|
||||
.collect();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user