Skip to content

Commit

Permalink
Amend
Browse files Browse the repository at this point in the history
  • Loading branch information
raphjaph committed Jan 27, 2025
1 parent 17ef2e2 commit 183c0bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/index/reorg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,11 @@ impl Reorg {
Ok(())
}

pub(crate) fn is_savepoint_required(index: &Index, height: u32) -> Result<bool> {
pub(crate) fn savepoint_required(index: &Index, height: u32) -> Result<bool> {
if index.settings.integration_test() {
return Ok(false);
}

let height = u64::from(height);

let last_savepoint_height = index
Expand Down Expand Up @@ -110,7 +114,7 @@ impl Reorg {
return Ok(());
}

if Self::is_savepoint_required(index, height)? {
if Self::savepoint_required(index, height)? {
let wtx = index.begin_write()?;

let savepoints = wtx.list_persistent_savepoints()?.collect::<Vec<u64>>();
Expand Down
3 changes: 1 addition & 2 deletions src/index/updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ impl Updater<'_> {
uncommitted += 1;

if uncommitted == self.index.settings.commit_interval()
|| (!self.index.settings.integration_test()
&& Reorg::is_savepoint_required(self.index, self.height)?)
|| Reorg::savepoint_required(self.index, self.height)?
{
self.commit(wtx, utxo_cache)?;
utxo_cache = HashMap::new();
Expand Down

0 comments on commit 183c0bb

Please sign in to comment.