Rewrite the non_witness_utxo check

This commit is contained in:
Alekos Filini 2021-05-06 11:35:58 +02:00
parent 17bcd8ed7d
commit 3c7bae9ce9
No known key found for this signature in database
GPG Key ID: 431401E4A4530061

View File

@ -862,13 +862,11 @@ where
// If we aren't allowed to use `witness_utxo`, ensure that every input has the // If we aren't allowed to use `witness_utxo`, ensure that every input has the
// `non_witness_utxo` // `non_witness_utxo`
if !sign_options.trust_witness_utxo { if !sign_options.trust_witness_utxo
for input in &psbt.inputs { && psbt.inputs.iter().any(|i| i.non_witness_utxo.is_none())
if input.non_witness_utxo.is_none() { {
return Err(Error::Signer(signer::SignerError::MissingNonWitnessUtxo)); return Err(Error::Signer(signer::SignerError::MissingNonWitnessUtxo));
} }
}
}
for signer in self for signer in self
.signers .signers