fix SelectCoinsByDenominations (#2074)

Should return all denoms, excluding some for privacy reason is the job for PrepareDenominate
This commit is contained in:
UdjinM6 2018-05-26 21:03:08 +03:00 committed by GitHub
parent 5d057cf664
commit 0260821f87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3034,13 +3034,6 @@ bool CWallet::SelectCoinsByDenominations(int nDenom, CAmount nValueMin, CAmount
for (const auto& nBit : vecBits) {
if(out.tx->tx->vout[out.i].nValue == vecPrivateSendDenominations[nBit]) {
if(nValueRet >= nValueMin) {
//randomly reduce the max amount we'll submit (for anonymity)
nValueMax -= insecure_rand.rand32(nValueMax/5);
//on average use 50% of the inputs or less
int r = insecure_rand.rand32(vCoins.size());
if((int)vecTxDSInRet.size() > r) return true;
}
nValueRet += out.tx->tx->vout[out.i].nValue;
vecTxDSInRet.push_back(CTxDSIn(txin, out.tx->tx->vout[out.i].scriptPubKey));
vCoinsRet.push_back(out);