Skip to content

Commit

Permalink
Rewrite the non_witness_utxo check
Browse files Browse the repository at this point in the history
  • Loading branch information
afilini committed May 6, 2021
1 parent 17bcd8e commit 3c7bae9
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -862,12 +862,10 @@ where

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

for signer in self
Expand Down

0 comments on commit 3c7bae9

Please sign in to comment.