fixed locking issue and added lower limit

This commit is contained in:
Evan Duffield 2014-10-08 14:14:36 -07:00
parent 413b7b44d9
commit 0a75b816e3
3 changed files with 10 additions and 7 deletions

View File

@ -1364,7 +1364,7 @@ bool CDarkSendPool::DoAutomaticDenominating(bool fDryRun, bool ready)
int64 balanceNeedsAnonymized = pwalletMain->GetBalance() - pwalletMain->GetAnonymizedBalance();
if(balanceNeedsAnonymized > maxAmount*COIN) balanceNeedsAnonymized= maxAmount*COIN;
if(balanceNeedsAnonymized < COIN*1.1){
if(balanceNeedsAnonymized < COIN*2.5){
LogPrintf("DoAutomaticDenominating : No funds detected in need of denominating \n");
return false;
}

View File

@ -385,6 +385,15 @@ void OverviewPage::runDoAutomaticDenomination(){
}
void OverviewPage::toggleDarksend(){
int64 balance = pwalletMain->GetBalance();
if(balance < 2.5*coin){
QMessageBox::warning(this, tr("Darksend"),
tr("Darksend requires at least 2.5 DRK to use."),
QMessageBox::Ok, QMessageBox::O
return;
}
darkSendPool.cachedNumBlocks = 0;
fEnableDarksend = !fEnableDarksend;

View File

@ -1784,9 +1784,6 @@ bool CWallet::CreateCollateralTransaction(CTransaction& txCollateral, std::strin
if (!SelectCoinsCollateral(vCoinsCollateral, nValueIn2))
{
BOOST_FOREACH(CTxIn v, vCoinsCollateral)
UnlockCoin(v.prevout);
strReason = "Error: Darksend requires a collateral transaction and could not locate an acceptable input!";
return false;
}
@ -1819,9 +1816,6 @@ bool CWallet::CreateCollateralTransaction(CTransaction& txCollateral, std::strin
vinNumber++;
}
BOOST_FOREACH(CTxIn v, vCoinsCollateral)
LockCoin(v.prevout);
return true;
}