Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: MakeCollateralAmounts stuck sometimes #166

Merged
merged 2 commits into from
Feb 7, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions src/darksend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1682,14 +1682,6 @@ 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);

Expand All @@ -1704,14 +1696,7 @@ bool CDarkSendPool::MakeCollateralAmounts()
vector< pair<CScript, int64_t> > 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;

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
Expand Down