diff --git a/src/util/psbt/error.rs b/src/util/psbt/error.rs index b1fd7337..b5dd63f9 100644 --- a/src/util/psbt/error.rs +++ b/src/util/psbt/error.rs @@ -68,9 +68,9 @@ pub enum Error { /// Hash-type hash_type: PsbtHash, /// Pre-image - preimage: Vec, + preimage: Box<[u8]>, /// Hash value - hash: Vec, + hash: Box<[u8]>, }, /// Data inconsistency/conflicting data during merge procedure MergeConflict(String), diff --git a/src/util/psbt/map/input.rs b/src/util/psbt/map/input.rs index ddcc1f8a..ea6274f5 100644 --- a/src/util/psbt/map/input.rs +++ b/src/util/psbt/map/input.rs @@ -311,8 +311,8 @@ where let val: Vec = Deserialize::deserialize(&raw_value)?; if ::hash(&val) != key_val { return Err(psbt::Error::InvalidPreimageHashPair { - preimage: val, - hash: Vec::from(key_val.borrow()), + preimage: val.into_boxed_slice(), + hash: Box::from(key_val.borrow()), hash_type: hash_type, } .into());