mirror of
https://github.com/dashpay/dash.git
synced 2024-12-29 13:59:06 +01:00
fixed rounds calculation
This commit is contained in:
parent
80105fba3e
commit
9c9853b251
20
src/main.cpp
20
src/main.cpp
@ -7067,24 +7067,34 @@ int CDarkSendPool::GetInputDarksendRounds(CTxIn in, int rounds)
|
||||
{
|
||||
if(rounds >= nDarksendRounds) return rounds;
|
||||
|
||||
printf("CDarkSendPool::GetInputDarksendRounds :: %d %s\n", rounds, in.ToString().c_str());
|
||||
CTransaction tx;
|
||||
uint256 hash;
|
||||
if(GetTransaction(in.prevout.hash, tx, hash, true)){
|
||||
bool fNonDenominatedFound = false;
|
||||
BOOST_FOREACH(CTxOut out, tx.vout){
|
||||
if(rounds == 0){ //make sure the final output is non-denominate
|
||||
bool found = false;
|
||||
BOOST_FOREACH(int64 d, darkSendDenominations)
|
||||
if(tx.vout[in.prevout.n].nValue == d) found = true;
|
||||
|
||||
if(!found) return -2;
|
||||
}
|
||||
bool fNonDenominatedFound = false;
|
||||
bool found = false;
|
||||
BOOST_FOREACH(CTxOut out, tx.vout){
|
||||
BOOST_FOREACH(int64 d, darkSendDenominations)
|
||||
if(out.nValue == d)
|
||||
found = true;
|
||||
if(!found) fNonDenominatedFound = true;
|
||||
if(fNonDenominatedFound) return rounds;
|
||||
}
|
||||
|
||||
if(!found) return rounds;
|
||||
|
||||
// find my vin and look that up
|
||||
BOOST_FOREACH(CTxIn in2, tx.vin)
|
||||
BOOST_FOREACH(CTxIn in2, tx.vin) {
|
||||
printf("CDarkSendPool::GetInputDarksendRounds :: %d %d %s - %s\n", rounds, pwalletMain->IsMine(in2), in2.ToString().c_str());
|
||||
if(pwalletMain->IsMine(in2))
|
||||
return GetInputDarksendRounds(in2, rounds+1);
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
@ -1633,7 +1633,7 @@ string CWallet::DarkSendDenominate(int64 nValue)
|
||||
int64 nValueIn = 0;
|
||||
|
||||
//try to use denominated funds (for added anonymity)
|
||||
if (true) //!SelectCoinsDarkDenominated(nTotalValue, vCoins, nValueIn))
|
||||
if (!SelectCoinsDarkDenominated(nTotalValue, vCoins, nValueIn))
|
||||
{
|
||||
vCoins.clear();
|
||||
nValueIn = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user