@@ -3735,13 +3735,13 @@ void AddKeypathToMap(const CWallet* pwallet, const CKeyID& keyID, std::map<CPubK
37353735 hd_keypaths.emplace (vchPubKey, std::move (info));
37363736}
37373737
3738- bool FillPSBT (const CWallet* pwallet, PartiallySignedTransaction& psbtx, const CTransaction* txConst, int sighash_type, bool sign, bool bip32derivs)
3738+ bool FillPSBT (const CWallet* pwallet, PartiallySignedTransaction& psbtx, int sighash_type, bool sign, bool bip32derivs)
37393739{
37403740 LOCK (pwallet->cs_wallet );
37413741 // Get all of the previous transactions
37423742 bool complete = true ;
3743- for (unsigned int i = 0 ; i < txConst ->vin .size (); ++i) {
3744- const CTxIn& txin = txConst ->vin [i];
3743+ for (unsigned int i = 0 ; i < psbtx. tx ->vin .size (); ++i) {
3744+ const CTxIn& txin = psbtx. tx ->vin [i];
37453745 PSBTInput& input = psbtx.inputs .at (i);
37463746
37473747 // If we don't know about this input, skip it and let someone else deal with it
@@ -3764,8 +3764,8 @@ bool FillPSBT(const CWallet* pwallet, PartiallySignedTransaction& psbtx, const C
37643764 }
37653765
37663766 // Fill in the bip32 keypaths and redeemscripts for the outputs so that hardware wallets can identify change
3767- for (unsigned int i = 0 ; i < txConst ->vout .size (); ++i) {
3768- const CTxOut& out = txConst ->vout .at (i);
3767+ for (unsigned int i = 0 ; i < psbtx. tx ->vout .size (); ++i) {
3768+ const CTxOut& out = psbtx. tx ->vout .at (i);
37693769 PSBTOutput& psbt_out = psbtx.outputs .at (i);
37703770
37713771 // Fill a SignatureData with output info
@@ -3830,14 +3830,10 @@ UniValue walletprocesspsbt(const JSONRPCRequest& request)
38303830 // Get the sighash type
38313831 int nHashType = ParseSighashString (request.params [2 ]);
38323832
3833- // Use CTransaction for the constant parts of the
3834- // transaction to avoid rehashing.
3835- const CTransaction txConst (*psbtx.tx );
3836-
38373833 // Fill transaction with our data and also sign
38383834 bool sign = request.params [1 ].isNull () ? true : request.params [1 ].get_bool ();
38393835 bool bip32derivs = request.params [3 ].isNull () ? false : request.params [3 ].get_bool ();
3840- bool complete = FillPSBT (pwallet, psbtx, &txConst, nHashType, sign, bip32derivs);
3836+ bool complete = FillPSBT (pwallet, psbtx, nHashType, sign, bip32derivs);
38413837
38423838 UniValue result (UniValue::VOBJ);
38433839 CDataStream ssTx (SER_NETWORK, PROTOCOL_VERSION);
@@ -3943,13 +3939,9 @@ UniValue walletcreatefundedpsbt(const JSONRPCRequest& request)
39433939 psbtx.outputs .push_back (PSBTOutput ());
39443940 }
39453941
3946- // Use CTransaction for the constant parts of the
3947- // transaction to avoid rehashing.
3948- const CTransaction txConst (*psbtx.tx );
3949-
39503942 // Fill transaction with out data but don't sign
39513943 bool bip32derivs = request.params [4 ].isNull () ? false : request.params [4 ].get_bool ();
3952- FillPSBT (pwallet, psbtx, &txConst, 1 , false , bip32derivs);
3944+ FillPSBT (pwallet, psbtx, 1 , false , bip32derivs);
39533945
39543946 // Serialize the PSBT
39553947 CDataStream ssTx (SER_NETWORK, PROTOCOL_VERSION);
0 commit comments