PR fixes.

This commit is contained in:
Gav Wood 2016-01-18 15:47:50 +01:00
parent 0222b3e081
commit 1eafdc7008
3 changed files with 11 additions and 4 deletions

View File

@ -1,6 +1,5 @@
use util::*;
use rocksdb::{Options, DB};
use rocksdb::DBCompactionStyle::DBUniversalCompaction;
use blockchain::{BlockChain, BlockProvider};
use views::BlockView;
use error::*;

View File

@ -68,7 +68,7 @@ impl JournalDB {
let mut r = RlpStream::new_list(2);
r.append(&now);
r.append(&index);
last = r.out();
last = r.drain();
&last
})).is_some() {
index += 1;
@ -78,7 +78,7 @@ impl JournalDB {
r.append(id);
r.append(&self.inserts);
r.append(&self.removes);
try!(self.backing.put(&last, &r.out()));
try!(self.backing.put(&last, r.as_raw()));
self.inserts.clear();
self.removes.clear();
}
@ -91,7 +91,7 @@ impl JournalDB {
let mut r = RlpStream::new_list(2);
r.append(&end_era);
r.append(&index);
last = r.out();
last = r.drain();
&last
})) {
let rlp = Rlp::new(&rlp_data);

View File

@ -142,6 +142,14 @@ impl RlpStream {
self.note_appended(1);
}
}
/// Drain the object and return the underlying ElasticArray.
pub fn drain(self) -> ElasticArray1024<u8> {
match self.is_finished() {
true => self.encoder.bytes,
false => panic!()
}
}
}
struct BasicEncoder {