From 6562412c93bdfbd5af3895e80648a89110e7bbb8 Mon Sep 17 00:00:00 2001 From: georgeee Date: Thu, 30 Nov 2023 11:31:13 +0100 Subject: [PATCH] Fix bug in Mask's copy --- src/lib/merkle_mask/masking_merkle_tree.ml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/merkle_mask/masking_merkle_tree.ml b/src/lib/merkle_mask/masking_merkle_tree.ml index 1049357c5337..12140f7c7f6e 100644 --- a/src/lib/merkle_mask/masking_merkle_tree.ml +++ b/src/lib/merkle_mask/masking_merkle_tree.ml @@ -624,16 +624,18 @@ module Make (Inputs : Inputs_intf.S) = struct (* copy tables in t; use same parent *) let copy t = + let detached_parent_signal = Async.Ivar.create () in { uuid = Uuid_unix.create () ; parent = Ok (get_parent t) - ; detached_parent_signal = Async.Ivar.create () + ; detached_parent_signal ; current_location = t.current_location ; depth = t.depth ; maps = maps_copy t.maps ; accumulated = Option.map t.accumulated ~f:(fun acc -> - { acc with - next = maps_copy acc.next + { base = acc.base + ; detached_next_signal = detached_parent_signal + ; next = maps_copy acc.next ; current = maps_copy acc.current } ) }