Fixes to FillPSBT

This commit is contained in:
Andrew Chow 2021-04-16 16:04:14 -04:00
parent e9bfff25db
commit 25df8aa12b
3 changed files with 5 additions and 11 deletions

View file

@ -4799,7 +4799,7 @@ static RPCHelpMan walletprocesspsbt()
// Don't sign, just fill data.
bool bip32derivs = request.params[3].isNull() ? true : request.params[3].get_bool();
bool complete = true;
const TransactionError err = pwallet->FillPSBT(psbtx, complete, nHashType, false, bip32derivs);
const TransactionError err = pwallet->FillPSBT(psbtx, complete, nHashType, false, bip32derivs, true);
if (err != TransactionError::OK) {
throw JSONRPCTransactionError(err);
}
@ -5119,7 +5119,7 @@ static RPCHelpMan walletcreatefundedpsbt()
// Fill transaction with out data but don't sign
bool bip32derivs = request.params[4].isNull() ? false : request.params[4].get_bool();
bool complete = true;
const TransactionError err = pwallet->FillPSBT(psbtx, complete, 1, false, bip32derivs);
const TransactionError err = pwallet->FillPSBT(psbtx, complete, 1, false, bip32derivs, true);
if (err != TransactionError::OK) {
throw JSONRPCTransactionError(err);
}

View file

@ -2090,7 +2090,6 @@ TransactionError DescriptorScriptPubKeyMan::FillPSBT(PartiallySignedTransaction&
*n_signed = 0;
}
for (unsigned int i = 0; i < psbtx.inputs.size(); ++i) {
const CTxIn& txin = psbtx.tx->vin[i];
PSBTInput& input = psbtx.inputs.at(i);
if (PSBTInputSigned(input)) {

View file

@ -2733,15 +2733,10 @@ TransactionError CWallet::FillPSBTData(PartiallySignedTransaction& psbtx, bool b
// We only need the non_witness_utxo, which is a superset of the witness_utxo.
// The signing code will switch to the smaller witness_utxo if this is ok.
input.non_witness_utxo = wtx.tx;
/*
// ELEMENTS: Grab the CA data
CAmount val_tmp;
wtx.GetNonIssuanceBlindingData(txin.prevout.n, nullptr, &val_tmp, &input.value_blinding_factor, &input.asset, &input.asset_blinding_factor);
if (val_tmp != -1) {
input.value = val_tmp;
// Set the UTXO rangeproof separately, if it's there
if (*input.prev_out < wtx.tx->witness.vtxoutwit.size() && !wtx.tx->witness.vtxoutwit[*input.prev_out].vchRangeproof.empty()) {
input.m_utxo_rangeproof = wtx.tx->witness.vtxoutwit[*input.prev_out].vchRangeproof;
}
*/
}
}
}