mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Merge #7967: [RPC] add feerate option to fundrawtransaction
04eaa90Add more clear interface for CoinControl.h regarding individual feerate (Jonas Schnelli)3b35e48[RPC] add feerate option to fundrawtransaction (Jonas Schnelli)
This commit is contained in:
@@ -1909,7 +1909,7 @@ bool CWallet::SelectCoins(const vector<COutput>& vAvailableCoins, const CAmount&
|
||||
return res;
|
||||
}
|
||||
|
||||
bool CWallet::FundTransaction(CMutableTransaction& tx, CAmount& nFeeRet, int& nChangePosInOut, std::string& strFailReason, bool includeWatching, bool lockUnspents, const CTxDestination& destChange)
|
||||
bool CWallet::FundTransaction(CMutableTransaction& tx, CAmount& nFeeRet, bool overrideEstimatedFeeRate, const CFeeRate& specificFeeRate, int& nChangePosInOut, std::string& strFailReason, bool includeWatching, bool lockUnspents, const CTxDestination& destChange)
|
||||
{
|
||||
vector<CRecipient> vecSend;
|
||||
|
||||
@@ -1924,6 +1924,9 @@ bool CWallet::FundTransaction(CMutableTransaction& tx, CAmount& nFeeRet, int& nC
|
||||
coinControl.destChange = destChange;
|
||||
coinControl.fAllowOtherInputs = true;
|
||||
coinControl.fAllowWatchOnly = includeWatching;
|
||||
coinControl.fOverrideFeeRate = overrideEstimatedFeeRate;
|
||||
coinControl.nFeeRate = specificFeeRate;
|
||||
|
||||
BOOST_FOREACH(const CTxIn& txin, tx.vin)
|
||||
coinControl.Select(txin.prevout);
|
||||
|
||||
@@ -2233,6 +2236,8 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend, CWalletTx& wt
|
||||
if (coinControl && nFeeNeeded > 0 && coinControl->nMinimumTotalFee > nFeeNeeded) {
|
||||
nFeeNeeded = coinControl->nMinimumTotalFee;
|
||||
}
|
||||
if (coinControl && coinControl->fOverrideFeeRate)
|
||||
nFeeNeeded = coinControl->nFeeRate.GetFee(nBytes);
|
||||
|
||||
// If we made it here and we aren't even able to meet the relay fee on the next pass, give up
|
||||
// because we must be at the maximum allowed fee.
|
||||
|
||||
Reference in New Issue
Block a user