don't limit ds-send inputs number artificially, fees should take care of it instead

This commit is contained in:
UdjinM6 2015-03-24 18:11:00 +03:00
parent 8e5d3bc1f7
commit ca53ddd32b

View File

@ -1486,6 +1486,8 @@ bool CWallet::SelectCoinsMinConf(int64_t nTargetValue, int nConfMine, int nConfT
bool CWallet::SelectCoins(int64_t nTargetValue, set<pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64_t& nValueRet, const CCoinControl* coinControl, AvailableCoinsType coin_type, bool useIX) const bool CWallet::SelectCoins(int64_t nTargetValue, set<pair<const CWalletTx*,unsigned int> >& setCoinsRet, int64_t& nValueRet, const CCoinControl* coinControl, AvailableCoinsType coin_type, bool useIX) const
{ {
// Note: this function should never be used for "always free" tx types like dstx
vector<COutput> vCoins; vector<COutput> vCoins;
AvailableCoins(vCoins, true, coinControl, ALL_COINS, useIX); AvailableCoins(vCoins, true, coinControl, ALL_COINS, useIX);
@ -1494,19 +1496,17 @@ bool CWallet::SelectCoins(int64_t nTargetValue, set<pair<const CWalletTx*,unsign
// Make outputs by looping through denominations, from large to small // Make outputs by looping through denominations, from large to small
BOOST_FOREACH(int64_t v, darkSendDenominations) BOOST_FOREACH(int64_t v, darkSendDenominations)
{ {
int added = 0;
BOOST_FOREACH(const COutput& out, vCoins) BOOST_FOREACH(const COutput& out, vCoins)
{ {
if(out.tx->vout[out.i].nValue == v //make sure it's the denom we're looking for if(out.tx->vout[out.i].nValue == v //make sure it's the denom we're looking for
&& nValueRet + out.tx->vout[out.i].nValue < nTargetValue + (0.1*COIN)+100 //round the amount up to .1DRK over && nValueRet + out.tx->vout[out.i].nValue < nTargetValue + (0.1*COIN)+100 //round the amount up to .1DRK over
&& added <= 50){ //don't add more than 50 of one denom type ){
CTxIn vin = CTxIn(out.tx->GetHash(),out.i); CTxIn vin = CTxIn(out.tx->GetHash(),out.i);
int rounds = GetInputDarksendRounds(vin); int rounds = GetInputDarksendRounds(vin);
// make sure it's actually anonymized // make sure it's actually anonymized
if(rounds < nDarksendRounds) continue; if(rounds < nDarksendRounds) continue;
nValueRet += out.tx->vout[out.i].nValue; nValueRet += out.tx->vout[out.i].nValue;
setCoinsRet.insert(make_pair(out.tx, out.i)); setCoinsRet.insert(make_pair(out.tx, out.i));
added++;
} }
} }
} }