Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/scriptpubkeyman.cpp
Show First 20 Lines • Show All 500 Lines • ▼ Show 20 Lines | LegacyScriptPubKeyMan::FillPSBT(PartiallySignedTransaction &psbtx, | ||||
bool bip32derivs) const { | bool bip32derivs) const { | ||||
for (size_t i = 0; i < psbtx.tx->vin.size(); ++i) { | for (size_t i = 0; i < psbtx.tx->vin.size(); ++i) { | ||||
PSBTInput &input = psbtx.inputs.at(i); | PSBTInput &input = psbtx.inputs.at(i); | ||||
if (PSBTInputSigned(input)) { | if (PSBTInputSigned(input)) { | ||||
continue; | continue; | ||||
} | } | ||||
// Verify input looks sane. This will check that we have at most one | |||||
// uxto, witness or non-witness. | |||||
if (!input.IsSane()) { | |||||
return TransactionError::INVALID_PSBT; | |||||
} | |||||
// Get the Sighash type | // Get the Sighash type | ||||
if (sign && input.sighash_type.getRawSigHashType() > 0 && | if (sign && input.sighash_type.getRawSigHashType() > 0 && | ||||
input.sighash_type != sighash_type) { | input.sighash_type != sighash_type) { | ||||
return TransactionError::SIGHASH_MISMATCH; | return TransactionError::SIGHASH_MISMATCH; | ||||
} | } | ||||
if (input.utxo.IsNull()) { | if (input.utxo.IsNull()) { | ||||
// There's no UTXO so we can just skip this now | // There's no UTXO so we can just skip this now | ||||
▲ Show 20 Lines • Show All 1,556 Lines • ▼ Show 20 Lines | DescriptorScriptPubKeyMan::FillPSBT(PartiallySignedTransaction &psbtx, | ||||
bool bip32derivs) const { | bool bip32derivs) const { | ||||
for (size_t i = 0; i < psbtx.tx->vin.size(); ++i) { | for (size_t i = 0; i < psbtx.tx->vin.size(); ++i) { | ||||
PSBTInput &input = psbtx.inputs.at(i); | PSBTInput &input = psbtx.inputs.at(i); | ||||
if (PSBTInputSigned(input)) { | if (PSBTInputSigned(input)) { | ||||
continue; | continue; | ||||
} | } | ||||
// Verify input looks sane. This will check that we have at most one | |||||
// uxto, witness or non-witness. | |||||
if (!input.IsSane()) { | |||||
return TransactionError::INVALID_PSBT; | |||||
} | |||||
// Get the Sighash type | // Get the Sighash type | ||||
if (sign && input.sighash_type.getRawSigHashType() > 0 && | if (sign && input.sighash_type.getRawSigHashType() > 0 && | ||||
input.sighash_type != sighash_type) { | input.sighash_type != sighash_type) { | ||||
return TransactionError::SIGHASH_MISMATCH; | return TransactionError::SIGHASH_MISMATCH; | ||||
} | } | ||||
// Get the scriptPubKey to know which SigningProvider to use | // Get the scriptPubKey to know which SigningProvider to use | ||||
CScript script; | CScript script; | ||||
▲ Show 20 Lines • Show All 169 Lines • Show Last 20 Lines |