From c6a0c554178cb7ed5f70717dac949572488f9ad5 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Sat, 15 Sep 2018 13:19:00 +0300 Subject: [PATCH] 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 --- src/privatesend-client.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/privatesend-client.cpp b/src/privatesend-client.cpp index 975212600d..3f2552e8e1 100644 --- a/src/privatesend-client.cpp +++ b/src/privatesend-client.cpp @@ -1327,7 +1327,7 @@ bool CPrivateSendClientSession::MakeCollateralAmounts(CConnman& connman) if (!pwalletMain) return false; std::vector 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;