diff --git a/src/lib/mina_base/transaction_validator.ml b/src/lib/mina_base/transaction_validator.ml index 0095eb8dd16..31f00701340 100644 --- a/src/lib/mina_base/transaction_validator.ml +++ b/src/lib/mina_base/transaction_validator.ml @@ -1,13 +1,13 @@ open Base let within_mask l ~f = - let l' = + let mask = Ledger.register_mask l (Ledger.Mask.create ~depth:(Ledger.depth l) ()) in - let r = f l' in - if Result.is_ok r then Ledger.commit l' ; + let r = f mask in + if Result.is_ok r then Ledger.commit mask ; ignore - (Ledger.unregister_mask_exn ~loc:Caml.__LOC__ l' : Ledger.unattached_mask) ; + (Ledger.unregister_mask_exn ~loc:Caml.__LOC__ mask : Ledger.unattached_mask) ; r let apply_user_command ~constraint_constants ~txn_global_slot l uc = diff --git a/src/lib/staged_ledger/staged_ledger.ml b/src/lib/staged_ledger/staged_ledger.ml index f64e188e15f..94f83a6a107 100644 --- a/src/lib/staged_ledger/staged_ledger.ml +++ b/src/lib/staged_ledger/staged_ledger.ml @@ -1778,13 +1778,14 @@ module T = struct |> not let with_ledger_mask base_ledger ~f = - let l = + let mask = Ledger.register_mask base_ledger (Ledger.Mask.create ~depth:(Ledger.depth base_ledger) ()) in - let r = f l in + let r = f mask in ignore - (Ledger.unregister_mask_exn ~loc:Caml.__LOC__ l : Ledger.unattached_mask) ; + ( Ledger.unregister_mask_exn ~loc:Caml.__LOC__ mask + : Ledger.unattached_mask ) ; r let create_diff