We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1b72ce3 commit ad1f46eCopy full SHA for ad1f46e
src/psbt.h
@@ -1177,8 +1177,13 @@ struct PartiallySignedTransaction
1177
inputs.push_back(input);
1178
1179
// Make sure the non-witness utxo matches the outpoint
1180
- if (input.non_witness_utxo && input.non_witness_utxo->GetHash() != tx->vin[i].prevout.hash) {
1181
- 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) {
1182
+ throw std::ios_base::failure("Non-witness UTXO does not match outpoint hash");
1183
+ }
1184
+ if (tx->vin[i].prevout.n >= input.non_witness_utxo->vout.size()) {
1185
+ throw std::ios_base::failure("Input specifies output index that does not exist");
1186
1187
}
1188
++i;
1189
0 commit comments