Skip to content

Commit

Permalink
Fix don't traverse when key doesn't exists
Browse files Browse the repository at this point in the history
  • Loading branch information
AurelienFT committed Mar 22, 2024
1 parent fadf864 commit b58dd17
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/trie/merkle_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,10 @@ impl<H: StarkHash> MerkleTree<H> {
// and other remaining child node -- if they're also edges.
//
// Then we are done.

let key_bytes = bitslice_to_bytes(key);
if db.get(&TrieKey::Flat(build_db_key(&self.identifier, &key_bytes)))?.is_none() {
return Ok(());
}
self.cache_leaf_modified
.insert(key_bytes.clone(), InsertOrRemove::Remove);

Expand Down

0 comments on commit b58dd17

Please sign in to comment.