Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 5,134 Lines • ▼ Show 20 Lines | bool FillPSBT(const CWallet *pwallet, PartiallySignedTransaction &psbtx, | ||||
bool complete = true; | bool complete = true; | ||||
for (size_t i = 0; i < txConst->vin.size(); ++i) { | for (size_t i = 0; i < txConst->vin.size(); ++i) { | ||||
const CTxIn &txin = txConst->vin[i]; | const CTxIn &txin = txConst->vin[i]; | ||||
PSBTInput &input = psbtx.inputs.at(i); | PSBTInput &input = psbtx.inputs.at(i); | ||||
// If we don't know about this input, skip it and let someone else deal | // If we don't know about this input, skip it and let someone else deal | ||||
// with it | // with it | ||||
const TxId &txid = txin.prevout.GetTxId(); | const TxId &txid = txin.prevout.GetTxId(); | ||||
const auto &it = pwallet->mapWallet.find(txid); | const auto it = pwallet->mapWallet.find(txid); | ||||
if (it != pwallet->mapWallet.end()) { | if (it != pwallet->mapWallet.end()) { | ||||
const CWalletTx &wtx = it->second; | const CWalletTx &wtx = it->second; | ||||
CTxOut utxo = wtx.tx->vout[txin.prevout.GetN()]; | CTxOut utxo = wtx.tx->vout[txin.prevout.GetN()]; | ||||
// Update UTXOs from the wallet. | |||||
input.utxo = utxo; | input.utxo = utxo; | ||||
} | } | ||||
// 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) { | ||||
throw JSONRPCError( | throw JSONRPCError( | ||||
RPC_DESERIALIZATION_ERROR, | RPC_DESERIALIZATION_ERROR, | ||||
▲ Show 20 Lines • Show All 359 Lines • Show Last 20 Lines |