Skip to content

Commit 7cc1e40

Browse files
chore: remove unnecessary block restore
1 parent a2e9eab commit 7cc1e40

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

stackslib/src/chainstate/stacks/index/storage.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3051,8 +3051,6 @@ impl<T: MarfTrieId> TrieStorageConnection<'_, T> {
30513051
self.unconfirmed()
30523052
);
30533053

3054-
let (saved_block_hash, saved_block_id) = self.get_cur_block_and_id();
3055-
30563054
let cur_block_id = block_id;
30573055
let mut node_hash_opt = None;
30583056
let mut patches: Vec<(u32, TriePtr, TrieNodePatch)> = vec![];
@@ -3064,7 +3062,6 @@ impl<T: MarfTrieId> TrieStorageConnection<'_, T> {
30643062
let node = node.apply_patches(&patches, cur_block_id).ok_or_else(|| {
30653063
Error::CorruptionError("Failed to apply patches to node".to_string())
30663064
})?;
3067-
self.open_block_maybe_id(&saved_block_hash, saved_block_id)?;
30683065
return Ok((node, node_hash_opt.unwrap_or(hash)));
30693066
}
30703067
Err(Error::Patch(hash_opt, node_patch)) => {
@@ -3081,12 +3078,10 @@ impl<T: MarfTrieId> TrieStorageConnection<'_, T> {
30813078
}
30823079
}
30833080
Err(e) => {
3084-
self.open_block_maybe_id(&saved_block_hash, saved_block_id)?;
30853081
return Err(e);
30863082
}
30873083
}
30883084
}
3089-
self.open_block_maybe_id(&saved_block_hash, saved_block_id)?;
30903085
return Err(Error::NodeTooDeep);
30913086
}
30923087

0 commit comments

Comments
 (0)