From 6f64afe5594159024b165a9528594aaf082628cb Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Sun, 7 Sep 2014 08:40:50 -0700 Subject: [PATCH] some fixes --- src/darksend.cpp | 3 +- src/qt/forms/overviewpage.ui | 497 ++++++++++++++++++++++++++++++++--- src/qt/overviewpage.cpp | 12 +- src/qt/overviewpage.h | 1 + src/wallet.cpp | 4 +- 5 files changed, 476 insertions(+), 41 deletions(-) diff --git a/src/darksend.cpp b/src/darksend.cpp index 70b31a9967..a7c56736cd 100644 --- a/src/darksend.cpp +++ b/src/darksend.cpp @@ -1317,7 +1317,7 @@ bool CDarkSendPool::SplitUpMoney(bool justCollateral) } if(!justCollateral){ - if(nTotalOut <= 1.1*COIN || vecSend.size() < 3) + if(nTotalOut <= 1.1*COIN || vecSend.size() < 2) return false; } else { if(nTotalOut <= 0.1*COIN || vecSend.size() < 1) @@ -1677,7 +1677,6 @@ bool CDarksendQueue::Relay() LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes){ - printf("relay...\n"); pnode->PushMessage("dsq", (*this)); } diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui index c6e6029fb4..9e0b39716a 100644 --- a/src/qt/forms/overviewpage.ui +++ b/src/qt/forms/overviewpage.ui @@ -190,31 +190,6 @@ QFrame::Raised - - - - 10 - 10 - 251 - 21 - - - - - - - - 75 - true - - - - Darksend - - - - - @@ -255,13 +230,6 @@ - - - - Anonymized - - - @@ -275,6 +243,13 @@ + + + + Anonymized + + + @@ -295,7 +270,7 @@ 10 140 - 251 + 241 51 @@ -309,6 +284,462 @@ true + + + + 10 + 10 + 66 + 20 + + + + + 75 + true + + + + Darksend + + + + + + 90 + 10 + 181 + 27 + + + + + + + + + 0 + 0 + 0 + + + + + + + 239 + 238 + 238 + + + + + + + 255 + 255 + 255 + + + + + + + 247 + 246 + 246 + + + + + + + 119 + 119 + 119 + + + + + + + 159 + 159 + 159 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 239 + 238 + 238 + + + + + + + 0 + 0 + 0 + + + + + + + 247 + 246 + 246 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 0 + 0 + 0 + + + + + + + 239 + 238 + 238 + + + + + + + 255 + 255 + 255 + + + + + + + 247 + 246 + 246 + + + + + + + 119 + 119 + 119 + + + + + + + 159 + 159 + 159 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 0 + 0 + 0 + + + + + + + 255 + 255 + 255 + + + + + + + 239 + 238 + 238 + + + + + + + 0 + 0 + 0 + + + + + + + 247 + 246 + 246 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 119 + 119 + 119 + + + + + + + 239 + 238 + 238 + + + + + + + 255 + 255 + 255 + + + + + + + 247 + 246 + 246 + + + + + + + 119 + 119 + 119 + + + + + + + 159 + 159 + 159 + + + + + + + 119 + 119 + 119 + + + + + + + 255 + 255 + 255 + + + + + + + 119 + 119 + 119 + + + + + + + 239 + 238 + 238 + + + + + + + 239 + 238 + 238 + + + + + + + 0 + 0 + 0 + + + + + + + 239 + 238 + 238 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + Qt::NoFocus + + + true + + + + + + true + + diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 5b678fc0d7..76ed2ce67a 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -192,6 +192,8 @@ void OverviewPage::setWalletModel(WalletModel *model) connect(model, SIGNAL(balanceChanged(qint64, qint64, qint64, qint64)), this, SLOT(setBalance(qint64, qint64, qint64, qint64))); connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); + + connect(ui->runAutoDenom, SIGNAL(clicked()), this, SLOT(runDoAutomaticDenomination())); } // update the display unit, to not use the default ("BTC") @@ -295,12 +297,9 @@ void OverviewPage::darkSendStatus() } - //if(!darkSendPool.sessionFoundMasternode) return; - int state = darkSendPool.GetState(); int entries = darkSendPool.GetEntriesCount(); int accepted = darkSendPool.GetLastEntryAccepted(); - //int countAccepted = darkSendPool.GetCountEntriesAccepted(); std::ostringstream convert; @@ -343,8 +342,7 @@ void OverviewPage::darkSendStatus() convert << "Status => UNKNOWN STATE : ID=" << state; } - if(state == POOL_STATUS_ERROR || state == POOL_STATUS_SUCCESS) darkSendPool.Check(); - + if(state == POOL_STATUS_ERROR || state == POOL_STATUS_SUCCESS) darkSendPool.Check(); QString s(convert.str().c_str()); @@ -358,3 +356,7 @@ void OverviewPage::darkSendStatus() // Get DarkSend Denomination Status } + +void OverviewPage::runDoAutomaticDenomination(){ + darkSendPool.DoAutomaticDenominating(); +} \ No newline at end of file diff --git a/src/qt/overviewpage.h b/src/qt/overviewpage.h index b2f809150f..82ca18f417 100644 --- a/src/qt/overviewpage.h +++ b/src/qt/overviewpage.h @@ -53,6 +53,7 @@ private: TransactionFilterProxy *filter; private slots: + void runDoAutomaticDenomination(); void updateDisplayUnit(); void handleTransactionClicked(const QModelIndex &index); void updateAlerts(const QString &warnings); diff --git a/src/wallet.cpp b/src/wallet.cpp index 5480313861..3fbcc62cc0 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1443,7 +1443,9 @@ bool CWallet::HasDarksendFeeInputs() const ) found_fee = true; } - return found_collateral && found_fee; + if(found_collateral && found_fee) return true; + + return false; } bool CWallet::SelectCoinsWithoutDenomination(int64 nTargetValue, set >& setCoinsRet, int64& nValueRet) const