aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorJoão Barbosa <joao@uphold.com>2016-02-11 01:07:22 +0000
committerJoão Barbosa <joao@uphold.com>2016-03-08 15:14:47 +0000
commitd6cc6a1830bb7e03701488ca30c46457434dec6c (patch)
tree7d4dab4705ac661f0ba761483e98b0cbf62cf069 /src/wallet/wallet.cpp
parent87d65622996d6b6539dba973a4427e542cc291c7 (diff)
downloadbitcoin-d6cc6a1830bb7e03701488ca30c46457434dec6c.tar.xz
Use CCoinControl selection in CWallet::FundTransaction
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 8ea957ee33..6c7173ede1 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -1669,7 +1669,7 @@ void CWallet::AvailableCoins(vector<COutput>& vCoins, bool fOnlyConfirmed, const
isminetype mine = IsMine(pcoin->vout[i]);
if (!(IsSpent(wtxid, i)) && mine != ISMINE_NO &&
!IsLockedCoin((*it).first, i) && (pcoin->vout[i].nValue > 0 || fIncludeZeroValue) &&
- (!coinControl || !coinControl->HasSelected() || coinControl->fAllowOtherInputs || coinControl->IsSelected((*it).first, i)))
+ (!coinControl || !coinControl->HasSelected() || coinControl->fAllowOtherInputs || coinControl->IsSelected(COutPoint((*it).first, i))))
vCoins.push_back(COutput(pcoin, i, nDepth,
((mine & ISMINE_SPENDABLE) != ISMINE_NO) ||
(coinControl && coinControl->fAllowWatchOnly && (mine & ISMINE_WATCH_SOLVABLE) != ISMINE_NO)));
@@ -1927,16 +1927,7 @@ bool CWallet::FundTransaction(CMutableTransaction& tx, CAmount &nFeeRet, int& nC
// Add new txins (keeping original txin scriptSig/order)
BOOST_FOREACH(const CTxIn& txin, wtx.vin)
{
- bool found = false;
- BOOST_FOREACH(const CTxIn& origTxIn, tx.vin)
- {
- if (txin.prevout.hash == origTxIn.prevout.hash && txin.prevout.n == origTxIn.prevout.n)
- {
- found = true;
- break;
- }
- }
- if (!found)
+ if (!coinControl.IsSelected(txin.prevout))
tx.vin.push_back(txin);
}