A couple of small fixes for mixing collaterals (#2294)

* No reasons to create mixing collaterals if we can't create denoms to mix

* Include non-anonymizable inputs when trying to make mixing collaterals
This commit is contained in:
UdjinM6 2018-09-15 13:19:00 +03:00 committed by GitHub
parent d192d642f6
commit c6a0c55417
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1327,7 +1327,7 @@ bool CPrivateSendClientSession::MakeCollateralAmounts(CConnman& connman)
if (!pwalletMain) return false;
std::vector<CompactTallyItem> vecTally;
if(!pwalletMain->SelectCoinsGrouppedByAddresses(vecTally, false)) {
if(!pwalletMain->SelectCoinsGrouppedByAddresses(vecTally, false, false)) {
LogPrint("privatesend", "CPrivateSendClientSession::MakeCollateralAmounts -- SelectCoinsGrouppedByAddresses can't find any inputs!\n");
return false;
}
@ -1522,6 +1522,9 @@ bool CPrivateSendClientSession::CreateDenominated(const CompactTallyItem& tallyI
} while (nOutputsTotal == 0 && !fSkip);
LogPrintf("CPrivateSendClientSession::CreateDenominated -- 3 - nOutputsTotal: %d, nValueLeft: %f\n", nOutputsTotal, (float)nValueLeft/COIN);
// No reasons to create mixing collaterals if we can't create denoms to mix
if (nOutputsTotal == 0) return false;
// if we have anything left over, it will be automatically send back as change - there is no need to send it manually
CCoinControl coinControl;