aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2018-03-07 12:18:37 -0500
committerAndrew Chow <achow101-github@achow101.com>2018-03-13 12:39:26 -0400
commit4b2716da46e96c45206db869b83c28c5fc7889f4 (patch)
tree79b43ea07fa17c0a2a56a3fcea75cd93aae510ba /src/wallet/wallet.cpp
parent7d77eb1a5b980a7d56acbf0b3861434c5e195c54 (diff)
Remove coinselection.h -> wallet.h circular dependency
Changes CInputCoin to coinselection and to use CTransactionRef in order to avoid a circular dependency. Also moves other coin selection specific variables out of wallet.h to coinselectoin.h
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index fe9e803d28..fbd515c47f 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -2516,7 +2516,7 @@ bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, const CoinEligibil
if (!OutputEligibleForSpending(output, eligibilty_filter))
continue;
- CInputCoin coin = CInputCoin(output.tx, output.i);
+ CInputCoin coin = CInputCoin(output.tx->tx, output.i);
if (coin.txout.nValue == nTargetValue)
{
@@ -2606,7 +2606,7 @@ bool CWallet::SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAm
if (!out.fSpendable)
continue;
nValueRet += out.tx->tx->vout[out.i].nValue;
- setCoinsRet.insert(CInputCoin(out.tx, out.i));
+ setCoinsRet.insert(CInputCoin(out.tx->tx, out.i));
}
return (nValueRet >= nTargetValue);
}
@@ -2628,7 +2628,7 @@ bool CWallet::SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAm
if (pcoin->tx->vout.size() <= outpoint.n)
return false;
nValueFromPresetInputs += pcoin->tx->vout[outpoint.n].nValue;
- setPresetCoins.insert(CInputCoin(pcoin, outpoint.n));
+ setPresetCoins.insert(CInputCoin(pcoin->tx, outpoint.n));
} else
return false; // TODO: Allow non-wallet inputs
}
@@ -2636,7 +2636,7 @@ bool CWallet::SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAm
// remove preset inputs from vCoins
for (std::vector<COutput>::iterator it = vCoins.begin(); it != vCoins.end() && coinControl && coinControl->HasSelected();)
{
- if (setPresetCoins.count(CInputCoin(it->tx, it->i)))
+ if (setPresetCoins.count(CInputCoin(it->tx->tx, it->i)))
it = vCoins.erase(it);
else
++it;