Skip to content

Commit

Permalink
fix(ledger): When copying root masks, copy the hashes matrix too
Browse files Browse the repository at this point in the history
If this is not done, the cloned mask will need to recompute its internal hashes, which is expensive.
  • Loading branch information
tizoc committed Mar 22, 2024
1 parent a0ed79f commit 1413033
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ledger/src/database/database_impl.rs
Expand Up @@ -61,7 +61,7 @@ impl DatabaseImpl<V2> {
naccounts: self.naccounts,
uuid: next_uuid(),
directory: new_directory,
hashes_matrix: HashesMatrix::new(self.depth as usize),
hashes_matrix: self.hashes_matrix.clone(),
// root_hash: RefCell::new(*self.root_hash.borrow()),
}
}
Expand Down

0 comments on commit 1413033

Please sign in to comment.