diff --git a/bin/sozo/src/commands/options/account/controller.rs b/bin/sozo/src/commands/options/account/controller.rs index 7a2ee8e719..ef41ef36ec 100644 --- a/bin/sozo/src/commands/options/account/controller.rs +++ b/bin/sozo/src/commands/options/account/controller.rs @@ -125,6 +125,9 @@ where } // Check if the new policies are equal to the ones in the existing session +// +// This function would compute the merkle root of the new policies and compare it with the root in +// the existing SessionMetadata. fn is_equal_to_existing(new_policies: &[Policy], session: &SessionMetadata) -> bool { let allowed_methods = new_policies .iter() @@ -145,7 +148,7 @@ fn is_equal_to_existing(new_policies: &[Policy], session: &SessionMetadata) -> b let root = MerkleTree::compute_root(hashes[0], allowed_methods[0].proof.clone()); - root != session.session.allowed_methods_root + root == session.session.allowed_methods_root } /// Policies are the building block of a session key. It's what defines what methods are allowed for