fix MakeCollateralAmounts stuck sometimes and wouldn't let denominating further
This commit is contained in:
parent
3a72da77ac
commit
fd7992dc61
@ -1682,14 +1682,8 @@ bool CDarkSendPool::SendRandomPaymentToSelf()
|
|||||||
// Split up large inputs or create fee sized inputs
|
// Split up large inputs or create fee sized inputs
|
||||||
bool CDarkSendPool::MakeCollateralAmounts()
|
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;
|
int64_t nTotalOut = 0;
|
||||||
|
|
||||||
LogPrintf("DoAutomaticDenominating: MakeCollateralAmounts: nSplitBalance %d nTotalBalance %d\n", nSplitBalance, pwalletMain->GetDenominatedBalance(false));
|
|
||||||
|
|
||||||
// make our change address
|
// make our change address
|
||||||
CReserveKey reservekey(pwalletMain);
|
CReserveKey reservekey(pwalletMain);
|
||||||
|
|
||||||
@ -1708,11 +1702,6 @@ bool CDarkSendPool::MakeCollateralAmounts()
|
|||||||
vecSend.push_back(make_pair(scriptChange, (DARKSEND_COLLATERAL*2)+DARKSEND_FEE));
|
vecSend.push_back(make_pair(scriptChange, (DARKSEND_COLLATERAL*2)+DARKSEND_FEE));
|
||||||
nTotalOut += (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;
|
CCoinControl *coinControl=NULL;
|
||||||
// try to use non-denominated and not mn-like funds
|
// try to use non-denominated and not mn-like funds
|
||||||
bool success = pwalletMain->CreateTransaction(vecSend, wtx, reservekey,
|
bool success = pwalletMain->CreateTransaction(vecSend, wtx, reservekey,
|
||||||
|
Loading…
Reference in New Issue
Block a user