mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 03:21:08 +03:00
Fix rm log not getting written to disk
Only the temporary remove log for the last block was written to disk, and then overwritten for every block. The fix writes the temp remove log (just last block) to the permanent remove log, and saves that to disk.
This commit is contained in:
parent
0fb15641fe
commit
2c6c8ed688
1 changed files with 3 additions and 1 deletions
|
@ -215,11 +215,13 @@ impl RemoveLog {
|
||||||
match self.removed.binary_search(&elmt) {
|
match self.removed.binary_search(&elmt) {
|
||||||
Ok(_) => continue,
|
Ok(_) => continue,
|
||||||
Err(idx) => {
|
Err(idx) => {
|
||||||
file.write_all(&ser::ser_vec(&elmt).unwrap()[..])?;
|
|
||||||
self.removed.insert(idx, *elmt);
|
self.removed.insert(idx, *elmt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for elmt in &self.removed {
|
||||||
|
file.write_all(&ser::ser_vec(&elmt).unwrap()[..])?;
|
||||||
|
}
|
||||||
self.removed_tmp = vec![];
|
self.removed_tmp = vec![];
|
||||||
file.sync_data()
|
file.sync_data()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue