mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Merge #9377: fundrawtransaction: Keep change-output keys by default, make it optional
c9f3062Add fundrawtransactions new reserveChangeKey option to the release notes (Jonas Schnelli)9eb325d[QA] Add test for fundrawtransactions new reserveChangeKey option (Jonas Schnelli)9aa4e6a[Wallet] Add an option to keep the change address key, true by default (Jonas Schnelli)
This commit is contained in:
@@ -2282,7 +2282,7 @@ bool CWallet::SelectCoins(const vector<COutput>& vAvailableCoins, const CAmount&
|
||||
return res;
|
||||
}
|
||||
|
||||
bool CWallet::FundTransaction(CMutableTransaction& tx, CAmount& nFeeRet, bool overrideEstimatedFeeRate, const CFeeRate& specificFeeRate, int& nChangePosInOut, std::string& strFailReason, bool includeWatching, bool lockUnspents, const std::set<int>& setSubtractFeeFromOutputs, 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 std::set<int>& setSubtractFeeFromOutputs, bool keepReserveKey, const CTxDestination& destChange)
|
||||
{
|
||||
vector<CRecipient> vecSend;
|
||||
|
||||
@@ -2331,6 +2331,10 @@ bool CWallet::FundTransaction(CMutableTransaction& tx, CAmount& nFeeRet, bool ov
|
||||
}
|
||||
}
|
||||
|
||||
// optionally keep the change output key
|
||||
if (keepReserveKey)
|
||||
reservekey.KeepKey();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user