fix accounts_db storage.reset() (#4094)

* fix accounts_db storage.reset()

* fix compilation errors, remove unused, fix test_accounts_grow() failure
This commit is contained in:
Rob Walker
2019-05-01 09:27:13 -07:00
committed by GitHub
parent ad27c30623
commit cb528af4e2
3 changed files with 151 additions and 62 deletions

View File

@@ -74,7 +74,7 @@ impl AppendVec {
.open(file)
.expect("Unable to open data file");
data.seek(SeekFrom::Start(size as u64)).unwrap();
data.seek(SeekFrom::Start((size - 1) as u64)).unwrap();
data.write_all(&[0]).unwrap();
data.seek(SeekFrom::Start(0)).unwrap();
data.flush().unwrap();
@@ -153,7 +153,7 @@ impl AppendVec {
end += val.1;
}
if (self.file_size as usize) <= end {
if (self.file_size as usize) < end {
return None;
}