mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-01 11:26:03 +02:00
[Wallet] Add an option to keep the change address key, true by default
This commit is contained in:
@@ -2192,7 +2192,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;
|
||||
|
||||
@@ -2241,6 +2241,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