Fixed depth tracking

This commit is contained in:
arkpar 2016-01-27 18:58:41 +01:00
parent aa9fb98a74
commit 698fa11e76
1 changed files with 4 additions and 2 deletions

View File

@ -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
}