mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
Add lockUnspents option to fundrawtransaction
This commit is contained in:
committed by
Wladimir J. van der Laan
parent
af4fe7fd12
commit
f2d0944eb3
@@ -1932,7 +1932,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, const CTxDestination& destChange)
|
||||
bool CWallet::FundTransaction(CMutableTransaction& tx, CAmount& nFeeRet, int& nChangePosInOut, std::string& strFailReason, bool includeWatching, bool lockUnspents, const CTxDestination& destChange)
|
||||
{
|
||||
vector<CRecipient> vecSend;
|
||||
|
||||
@@ -1962,7 +1962,15 @@ bool CWallet::FundTransaction(CMutableTransaction& tx, CAmount& nFeeRet, int& nC
|
||||
BOOST_FOREACH(const CTxIn& txin, wtx.vin)
|
||||
{
|
||||
if (!coinControl.IsSelected(txin.prevout))
|
||||
{
|
||||
tx.vin.push_back(txin);
|
||||
|
||||
if (lockUnspents)
|
||||
{
|
||||
LOCK2(cs_main, cs_wallet);
|
||||
LockCoin(txin.prevout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user