From 698fa11e76b798028ed0025bcddbf894a14a88a3 Mon Sep 17 00:00:00 2001 From: arkpar Date: Wed, 27 Jan 2016 18:58:41 +0100 Subject: [PATCH] Fixed depth tracking --- util/src/rlp/rlpstream.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util/src/rlp/rlpstream.rs b/util/src/rlp/rlpstream.rs index 7a0223d23..0c7418a8b 100644 --- a/util/src/rlp/rlpstream.rs +++ b/util/src/rlp/rlpstream.rs @@ -42,9 +42,11 @@ impl Stream for RlpStream { } fn append<'a, E>(&'a mut self, value: &E) -> &'a mut Self where E: Encodable { + let depth = self.unfinished_lists.len(); value.rlp_append(self); - // if list is finished, prepend the length - self.note_appended(1); + if depth == self.unfinished_lists.len() { + self.note_appended(1); + } self }