Skip to content

Commit

Permalink
Merge branch 'merkle-perf' into merkle-perf-a
Browse files Browse the repository at this point in the history
  • Loading branch information
eljobe committed May 22, 2024
2 parents 9539e9a + 4306ec3 commit bbf8919
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arbitrator/prover/src/merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,12 @@ fn new_layer(ty: MerkleType, layer: &Vec<Bytes32>, empty_hash: &'static Bytes32)

impl Clone for Merkle {
fn clone(&self) -> Self {
Merkle::new_advanced(self.ty, self.layers.lock().data[0].clone(), self.min_depth)
let leaves = if self.layers.lock().data.is_empty() {
vec![]
} else {
self.layers.lock().data[0].clone()
};
Merkle::new_advanced(self.ty, leaves, self.min_depth)
}
}

Expand Down

0 comments on commit bbf8919

Please sign in to comment.