Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/psbtwallet.cpp
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | for (size_t i = 0; i < psbtx.tx->vin.size(); ++i) { | ||||
script = input.utxo.scriptPubKey; | script = input.utxo.scriptPubKey; | ||||
} else { | } else { | ||||
// There's no UTXO so we can just skip this now | // There's no UTXO so we can just skip this now | ||||
complete = false; | complete = false; | ||||
continue; | continue; | ||||
} | } | ||||
SignatureData sigdata; | SignatureData sigdata; | ||||
input.FillSignatureData(sigdata); | input.FillSignatureData(sigdata); | ||||
const SigningProvider *provider = | std::unique_ptr<SigningProvider> provider = | ||||
pwallet->GetSigningProvider(script, sigdata); | pwallet->GetSigningProvider(script, sigdata); | ||||
if (!provider) { | if (!provider) { | ||||
complete = false; | complete = false; | ||||
continue; | continue; | ||||
} | } | ||||
complete &= | complete &= SignPSBTInput( | ||||
SignPSBTInput(HidingSigningProvider(provider, !sign, !bip32derivs), | HidingSigningProvider(provider.get(), !sign, !bip32derivs), psbtx, | ||||
psbtx, i, sighash_type); | 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); | const CTxOut &out = psbtx.tx->vout.at(i); | ||||
const SigningProvider *provider = | std::unique_ptr<SigningProvider> provider = | ||||
pwallet->GetSigningProvider(out.scriptPubKey); | pwallet->GetSigningProvider(out.scriptPubKey); | ||||
if (provider) { | if (provider) { | ||||
UpdatePSBTOutput( | UpdatePSBTOutput( | ||||
HidingSigningProvider(provider, true, !bip32derivs), psbtx, i); | HidingSigningProvider(provider.get(), true, !bip32derivs), | ||||
psbtx, i); | |||||
} | } | ||||
} | } | ||||
return TransactionError::OK; | return TransactionError::OK; | ||||
} | } |