Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/wallet.cpp
Show First 20 Lines • Show All 2,748 Lines • ▼ Show 20 Lines | for (auto &input : tx.vin) { | ||||
} | } | ||||
UpdateTransaction(tx, nIn, sigdata); | UpdateTransaction(tx, nIn, sigdata); | ||||
nIn++; | nIn++; | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
bool CWallet::FundTransaction(CMutableTransaction &tx, Amount &nFeeRet, | bool CWallet::FundTransaction(CMutableTransaction &tx, Amount &nFeeRet, | ||||
bool overrideEstimatedFeeRate, | |||||
const CFeeRate &specificFeeRate, | |||||
int &nChangePosInOut, std::string &strFailReason, | int &nChangePosInOut, std::string &strFailReason, | ||||
bool includeWatching, bool lockUnspents, | bool lockUnspents, | ||||
const std::set<int> &setSubtractFeeFromOutputs, | const std::set<int> &setSubtractFeeFromOutputs, | ||||
bool keepReserveKey, | CCoinControl coinControl, bool keepReserveKey) { | ||||
const CTxDestination &destChange) { | |||||
std::vector<CRecipient> vecSend; | std::vector<CRecipient> vecSend; | ||||
// Turn the txout set into a CRecipient vector. | // Turn the txout set into a CRecipient vector. | ||||
for (size_t idx = 0; idx < tx.vout.size(); idx++) { | for (size_t idx = 0; idx < tx.vout.size(); idx++) { | ||||
const CTxOut &txOut = tx.vout[idx]; | const CTxOut &txOut = tx.vout[idx]; | ||||
CRecipient recipient = {txOut.scriptPubKey, txOut.nValue, | CRecipient recipient = {txOut.scriptPubKey, txOut.nValue, | ||||
setSubtractFeeFromOutputs.count(idx) == 1}; | setSubtractFeeFromOutputs.count(idx) == 1}; | ||||
vecSend.push_back(recipient); | vecSend.push_back(recipient); | ||||
} | } | ||||
CCoinControl coinControl; | |||||
coinControl.destChange = destChange; | |||||
coinControl.fAllowOtherInputs = true; | coinControl.fAllowOtherInputs = true; | ||||
coinControl.fAllowWatchOnly = includeWatching; | |||||
coinControl.fOverrideFeeRate = overrideEstimatedFeeRate; | |||||
coinControl.nFeeRate = specificFeeRate; | |||||
for (const CTxIn &txin : tx.vin) { | for (const CTxIn &txin : tx.vin) { | ||||
coinControl.Select(txin.prevout); | coinControl.Select(txin.prevout); | ||||
} | } | ||||
CReserveKey reservekey(this); | CReserveKey reservekey(this); | ||||
CWalletTx wtx; | CWalletTx wtx; | ||||
if (!CreateTransaction(vecSend, wtx, reservekey, nFeeRet, nChangePosInOut, | if (!CreateTransaction(vecSend, wtx, reservekey, nFeeRet, nChangePosInOut, | ||||
▲ Show 20 Lines • Show All 1,679 Lines • Show Last 20 Lines |