From 4ded1cc3d46a809601301e152de6163184ab5667 Mon Sep 17 00:00:00 2001 From: Robert Habermeier Date: Mon, 13 Jun 2016 15:07:54 +0200 Subject: [PATCH] chunk remainder at end of each stage --- ethcore/src/pv64/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ethcore/src/pv64/mod.rs b/ethcore/src/pv64/mod.rs index 2b60e4ee2..8283cfdc9 100644 --- a/ethcore/src/pv64/mod.rs +++ b/ethcore/src/pv64/mod.rs @@ -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) } }