From fd7992dc616b2b4a41ab97bc6425361047fc9612 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Sat, 7 Feb 2015 05:18:37 +0300 Subject: [PATCH 1/2] fix MakeCollateralAmounts stuck sometimes and wouldn't let denominating further --- src/darksend.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/darksend.cpp b/src/darksend.cpp index c35ced95f665c..d67207968ab6a 100644 --- a/src/darksend.cpp +++ b/src/darksend.cpp @@ -1682,14 +1682,8 @@ bool CDarkSendPool::SendRandomPaymentToSelf() // Split up large inputs or create fee sized inputs bool CDarkSendPool::MakeCollateralAmounts() { - // should split up to remaining amount only... - int64_t nTotalBalance = pwalletMain->GetBalance(); - int64_t nSplitBalance = nAnonymizeDarkcoinAmount*COIN - pwalletMain->GetDenominatedBalance(); - if(nSplitBalance > nTotalBalance) nSplitBalance = nTotalBalance; int64_t nTotalOut = 0; - LogPrintf("DoAutomaticDenominating: MakeCollateralAmounts: nSplitBalance %d nTotalBalance %d\n", nSplitBalance, pwalletMain->GetDenominatedBalance(false)); - // make our change address CReserveKey reservekey(pwalletMain); @@ -1708,11 +1702,6 @@ bool CDarkSendPool::MakeCollateralAmounts() vecSend.push_back(make_pair(scriptChange, (DARKSEND_COLLATERAL*2)+DARKSEND_FEE)); nTotalOut += (DARKSEND_COLLATERAL*2)+DARKSEND_FEE; - if(nTotalOut > nSplitBalance) { - LogPrintf("MakeCollateralAmounts: Not enough balance to split\n"); - return false; - } - CCoinControl *coinControl=NULL; // try to use non-denominated and not mn-like funds bool success = pwalletMain->CreateTransaction(vecSend, wtx, reservekey, From fdbeedfa963b846d9091a6739fc7f5c66ad54077 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Sat, 7 Feb 2015 05:26:59 +0300 Subject: [PATCH 2/2] fix MakeCollateralAmounts - cleaned more unneeded calculations --- src/darksend.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/darksend.cpp b/src/darksend.cpp index d67207968ab6a..120e0c59babd0 100644 --- a/src/darksend.cpp +++ b/src/darksend.cpp @@ -1682,8 +1682,6 @@ bool CDarkSendPool::SendRandomPaymentToSelf() // Split up large inputs or create fee sized inputs bool CDarkSendPool::MakeCollateralAmounts() { - int64_t nTotalOut = 0; - // make our change address CReserveKey reservekey(pwalletMain); @@ -1698,9 +1696,7 @@ bool CDarkSendPool::MakeCollateralAmounts() vector< pair > vecSend; vecSend.push_back(make_pair(scriptChange, (DARKSEND_COLLATERAL*2)+DARKSEND_FEE)); - nTotalOut += (DARKSEND_COLLATERAL*2)+DARKSEND_FEE; vecSend.push_back(make_pair(scriptChange, (DARKSEND_COLLATERAL*2)+DARKSEND_FEE)); - nTotalOut += (DARKSEND_COLLATERAL*2)+DARKSEND_FEE; CCoinControl *coinControl=NULL; // try to use non-denominated and not mn-like funds