change blocktree*::storage_size() to return Option<u64> to handle live fs changes (#7401)

This commit is contained in:
Sunny Gleason
2019-12-10 19:12:49 -05:00
committed by GitHub
parent 12d471e2da
commit 06415de8ee
3 changed files with 17 additions and 13 deletions

View File

@@ -1493,7 +1493,7 @@ impl Blocktree {
self.last_root()
}
pub fn storage_size(&self) -> u64 {
pub fn storage_size(&self) -> Option<u64> {
self.db.storage_size()
}
}

View File

@@ -580,8 +580,8 @@ impl Database {
self.backend.write(batch.write_batch)
}
pub fn storage_size(&self) -> u64 {
get_size(&self.path).expect("failure while reading ledger directory size")
pub fn storage_size(&self) -> Option<u64> {
get_size(&self.path).ok()
}
}