Fix bug in Orchard witness calculation #80

Merged
pitmutt merged 1 commits from rav001 into dev040 2024-05-07 20:21:20 +00:00
1 changed files with 11 additions and 11 deletions

View File

@ -1562,17 +1562,17 @@ pub extern "C" fn rust_wrapper_update_orchard_witness(
let n = MerkleHashOrchard::from_cmx(&orchard_note_comm.unwrap());
iw.append(n);
}
let mut out_bytes: Vec<u8> = Vec::new();
let result = write_incremental_witness(&iw, &mut out_bytes);
match result {
Ok(()) => {
let h = Hhex { bytes: out_bytes};
marshall_to_haskell_var(&h, out, out_len, RW);
},
Err(_e) => {
let h0 = Hhex { bytes: vec![0]};
marshall_to_haskell_var(&h0, out, out_len, RW);
}
}
let mut out_bytes: Vec<u8> = Vec::new();
let result = write_incremental_witness(&iw, &mut out_bytes);
match result {
Ok(()) => {
let h = Hhex { bytes: out_bytes};
marshall_to_haskell_var(&h, out, out_len, RW);
},
Err(_e) => {
let h0 = Hhex { bytes: vec![0]};
marshall_to_haskell_var(&h0, out, out_len, RW);
}
}
}