chunk remainder at end of each stage

This commit is contained in:
Robert Habermeier 2016-06-13 15:07:54 +02:00
parent 10c2302b55
commit 4ded1cc3d4
1 changed files with 9 additions and 0 deletions

View File

@ -124,6 +124,10 @@ impl<'a> BlockChunker<'a> {
chunk_hashes.push(self.write_chunk(path));
}
if self.rlps.len() != 0 {
chunk_hashes.push(self.write_chunk(path));
}
chunk_hashes
}
}
@ -152,6 +156,7 @@ impl<'a> StateChunker<'a> {
self.write_chunk();
}
self.cur_size += pair.len();
self.rlps.push(pair);
}
@ -210,6 +215,10 @@ impl<'a> StateChunker<'a> {
chunker.push(account_key, fat_rlp);
}
if chunker.cur_size != 0 {
chunker.write_chunk();
}
Ok(chunker.hashes)
}
}