Skip to content

Commit 7f4adf5

Browse files
committed
psbt finalizer code cleanup
1 parent f8dc749 commit 7f4adf5

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/psbt/finalizer.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -274,20 +274,12 @@ pub fn finalize_helper<C: secp256k1::Verification>(
274274
for (n, input) in psbt.inputs.iter().enumerate() {
275275
let target = input.sighash_type.unwrap_or(bitcoin::EcdsaSigHashType::All);
276276
for (key, ecdsa_sig) in &input.partial_sigs {
277-
let flag = bitcoin::EcdsaSigHashType::from_u32_standard(ecdsa_sig.hash_ty as u32)
278-
.map_err(|_| {
279-
super::Error::InputError(
280-
InputError::Interpreter(interpreter::Error::NonStandardSigHash(
281-
ecdsa_sig.to_vec(),
282-
)),
283-
n,
284-
)
285-
})?;
286-
if target != flag {
277+
if target != ecdsa_sig.hash_ty {
278+
// hash_ty is guaranteed to follow standardness rules
287279
return Err(Error::InputError(
288280
InputError::WrongSigHashFlag {
289281
required: target,
290-
got: flag,
282+
got: ecdsa_sig.hash_ty,
291283
pubkey: *key,
292284
},
293285
n,

0 commit comments

Comments
 (0)