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:
Robert Habermeier
2016-09-21 12:56:13 +02:00
committed by Gav Wood
parent 8c111da70b
commit a100b9d09e
9 changed files with 62 additions and 37 deletions

View File

@@ -358,7 +358,8 @@ pub fn chunk_state<'a>(db: &HashDB, root: &H256, writer: &Mutex<SnapshotWriter +
let mut used_code = HashSet::new();
// account_key here is the address' hash.
for (account_key, account_data) in account_trie.iter() {
for item in try!(account_trie.iter()) {
let (account_key, account_data) = try!(item);
let account = Account::from_thin_rlp(account_data);
let account_key_hash = H256::from_slice(&account_key);