Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/psbtwallet.cpp
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | for (size_t i = 0; i < psbtx.tx->vin.size(); ++i) { | ||||
complete &= | complete &= | ||||
SignPSBTInput(HidingSigningProvider(pwallet, !sign, !bip32derivs), | SignPSBTInput(HidingSigningProvider(pwallet, !sign, !bip32derivs), | ||||
psbtx, i, sighash_type); | psbtx, i, sighash_type); | ||||
} | } | ||||
// Fill in the bip32 keypaths and redeemscripts for the outputs so that | // Fill in the bip32 keypaths and redeemscripts for the outputs so that | ||||
// hardware wallets can identify change | // hardware wallets can identify change | ||||
for (size_t i = 0; i < psbtx.tx->vout.size(); ++i) { | for (size_t i = 0; i < psbtx.tx->vout.size(); ++i) { | ||||
const CTxOut &out = psbtx.tx->vout.at(i); | UpdatePSBTOutput(HidingSigningProvider(pwallet, true, !bip32derivs), | ||||
PSBTOutput &psbt_out = psbtx.outputs.at(i); | psbtx, i); | ||||
// Fill a SignatureData with output info | |||||
SignatureData sigdata; | |||||
psbt_out.FillSignatureData(sigdata); | |||||
MutableTransactionSignatureCreator creator( | |||||
psbtx.tx.get_ptr(), 0, out.nValue, SigHashType().withForkId()); | |||||
ProduceSignature(HidingSigningProvider(pwallet, true, !bip32derivs), | |||||
creator, out.scriptPubKey, sigdata); | |||||
psbt_out.FromSignatureData(sigdata); | |||||
} | } | ||||
return TransactionError::OK; | return TransactionError::OK; | ||||
} | } |