fix(rust): orchard hash length check

This commit is contained in:
Rene Vergara 2024-10-28 12:25:34 -05:00
parent 2e9e6d8831
commit b6d490d053
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2

View file

@ -1590,7 +1590,7 @@ pub extern "C" fn rust_wrapper_combine_orchard_nodes(
){
let left_in: Vec<u8> = marshall_from_haskell_var(left, left_len, RW);
let right_in: Vec<u8> = marshall_from_haskell_var(right, right_len, RW);
if left_in.len() > 1 {
if left_in.len() == 1 {
let n = MerkleHashOrchard::combine(Level::new(level), &MerkleHashOrchard::empty_leaf(), &MerkleHashOrchard::empty_leaf());
let h = Hhex { bytes: n.to_bytes().to_vec() };
marshall_to_haskell_var(&h, out, out_len, RW);