Skip to content

Commit

Permalink
Update src/psbt.h file
Browse files Browse the repository at this point in the history
  • Loading branch information
janus committed Jan 30, 2025
1 parent 1b72ce3 commit ad1f46e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/psbt.h
Original file line number Diff line number Diff line change
Expand Up @@ -1177,8 +1177,13 @@ struct PartiallySignedTransaction
inputs.push_back(input);

// Make sure the non-witness utxo matches the outpoint
if (input.non_witness_utxo && input.non_witness_utxo->GetHash() != tx->vin[i].prevout.hash) {
throw std::ios_base::failure("Non-witness UTXO does not match outpoint hash");
if (input.non_witness_utxo) {
if (input.non_witness_utxo->GetHash() != tx->vin[i].prevout.hash) {
throw std::ios_base::failure("Non-witness UTXO does not match outpoint hash");
}
if (tx->vin[i].prevout.n >= input.non_witness_utxo->vout.size()) {
throw std::ios_base::failure("Input specifies output index that does not exist");
}
}
++i;
}
Expand Down

0 comments on commit ad1f46e

Please sign in to comment.