flush on drop

This commit is contained in:
NikVolf 2016-12-14 19:48:20 +01:00
parent e3c1399b9e
commit 9aebc736e1
1 changed files with 6 additions and 0 deletions

View File

@ -459,6 +459,12 @@ impl Storage {
}
}
impl Drop for Storage {
fn drop(&mut self) {
self.database.flush();
}
}
impl BlockHeaderProvider for Storage {
fn block_header_bytes(&self, block_ref: BlockRef) -> Option<Bytes> {
self.resolve_hash(block_ref).and_then(|h| self.get(COL_BLOCK_HEADERS, &*h))