diff --git a/src/clientversion.h b/src/clientversion.h index 19419dfc85..ea119452fa 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -9,7 +9,7 @@ #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 10 #define CLIENT_VERSION_REVISION 13 -#define CLIENT_VERSION_BUILD 8 +#define CLIENT_VERSION_BUILD 9 // Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true diff --git a/src/darksend.cpp b/src/darksend.cpp index 8a4a84b932..28e8d8e524 100644 --- a/src/darksend.cpp +++ b/src/darksend.cpp @@ -116,7 +116,7 @@ void CDarkSendPool::Check() if(fDebug) LogPrintf("CDarkSendPool::Check() - entries count %lu\n", entries.size()); // If entries is full, then move on to the next phase - if(state == POOL_STATUS_ACCEPTING_ENTRIES && entries.size() >= POOL_MAX_TRANSACTIONS) + if(state == POOL_STATUS_ACCEPTING_ENTRIES && entries.size() >= GetMaxPoolTransactions()) { if(fDebug) LogPrintf("CDarkSendPool::Check() -- ACCEPTING OUTPUTS\n"); UpdateState(POOL_STATUS_FINALIZE_TRANSACTION); @@ -271,7 +271,7 @@ void CDarkSendPool::CheckTimeout(){ } /* Check to see if we're ready for submissions from clients */ - if(state == POOL_STATUS_QUEUE && sessionUsers == POOL_MAX_TRANSACTIONS) { + if(state == POOL_STATUS_QUEUE && sessionUsers == GetMaxPoolTransactions()) { CDarksendQueue dsq; dsq.nDenom = GetDenominationsByAmount(sessionAmount); dsq.vin = vinMasterNode; @@ -422,7 +422,7 @@ bool CDarkSendPool::AddEntry(const std::vector& newInput, const int64& nA return false; } - if(entries.size() >= POOL_MAX_TRANSACTIONS){ + if(entries.size() >= GetMaxPoolTransactions()){ if(fDebug) LogPrintf ("CDarkSendPool::AddEntry - entries is full!\n"); error = "entries is full"; sessionUsers--; @@ -1303,9 +1303,10 @@ bool CDarkSendPool::SplitUpMoney(bool justCollateral) nTotalOut += (DARKSEND_COLLATERAL*5)+(DARKSEND_FEE*5); // if over 1000, start by adding 1 darksend compatible input - if(nTotalBalance > 999*COIN){ - vecSend.push_back(make_pair(scriptChange, 999*COIN)); - nTotalOut += (999*COIN); + int64 compatibleDsInput = 998*COIN; + if(nTotalBalance > compatibleDsInput){ + vecSend.push_back(make_pair(scriptChange, compatibleDsInput)); + nTotalOut += (compatibleDsInput); } // ****** Add outputs in bases of two from 4096 darkcoin in reverse *** / @@ -1540,10 +1541,10 @@ bool CDarkSendPool::IsCompatibleWithSession(int64 nAmount, std::string& strReaso return true; } - if((state != POOL_STATUS_ACCEPTING_ENTRIES && state != POOL_STATUS_QUEUE) || sessionUsers >= POOL_MAX_TRANSACTIONS){ + if((state != POOL_STATUS_ACCEPTING_ENTRIES && state != POOL_STATUS_QUEUE) || sessionUsers >= GetMaxPoolTransactions()){ if((state != POOL_STATUS_ACCEPTING_ENTRIES && state != POOL_STATUS_QUEUE)) strReason = "incompatible mode"; - if(sessionUsers >= POOL_MAX_TRANSACTIONS) strReason = "masternode queue is full"; - LogPrintf("CDarkSendPool::IsCompatibleWithSession - incompatible mode, return false %d %d\n", state != POOL_STATUS_ACCEPTING_ENTRIES, sessionUsers >= POOL_MAX_TRANSACTIONS); + if(sessionUsers >= GetMaxPoolTransactions()) strReason = "masternode queue is full"; + LogPrintf("CDarkSendPool::IsCompatibleWithSession - incompatible mode, return false %d %d\n", state != POOL_STATUS_ACCEPTING_ENTRIES, sessionUsers >= GetMaxPoolTransactions()); return false; } diff --git a/src/darksend.h b/src/darksend.h index 721cb4ab02..708b851344 100644 --- a/src/darksend.h +++ b/src/darksend.h @@ -369,6 +369,16 @@ public: state = newState; } + int GetMaxPoolTransactions() + { + //if we're on testnet, just use two transactions per merge + if(fTestNet) return 2; + + //use the production amount + return POOL_MAX_TRANSACTIONS; + } + + // Are these outputs compatible with other client in the pool? bool IsCompatibleWithEntries(std::vector vout); // Is this amount compatible with other client in the pool? diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index bcdaba3320..b0b9b63f92 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -337,10 +337,10 @@ void OverviewPage::darkSendStatus() showingDarkSendMessage = 0; } } else { - if(showingDarkSendMessage % 70 <= 40) convert << "Submitted to masternode, entries " << entries << "/" << POOL_MAX_TRANSACTIONS; - else if(showingDarkSendMessage % 70 <= 50) convert << "Submitted to masternode, Waiting for more entries (" << entries << "/" << POOL_MAX_TRANSACTIONS << " ) ."; - else if(showingDarkSendMessage % 70 <= 60) convert << "Submitted to masternode, Waiting for more entries (" << entries << "/" << POOL_MAX_TRANSACTIONS << " ) .."; - else if(showingDarkSendMessage % 70 <= 70) convert << "Submitted to masternode, Waiting for more entries (" << entries << "/" << POOL_MAX_TRANSACTIONS << " ) ..."; + if(showingDarkSendMessage % 70 <= 40) convert << "Submitted to masternode, entries " << entries << "/" << darkSendPool.GetMaxPoolTransactions(); + else if(showingDarkSendMessage % 70 <= 50) convert << "Submitted to masternode, Waiting for more entries (" << entries << "/" << darkSendPool.GetMaxPoolTransactions() << " ) ."; + else if(showingDarkSendMessage % 70 <= 60) convert << "Submitted to masternode, Waiting for more entries (" << entries << "/" << darkSendPool.GetMaxPoolTransactions() << " ) .."; + else if(showingDarkSendMessage % 70 <= 70) convert << "Submitted to masternode, Waiting for more entries (" << entries << "/" << darkSendPool.GetMaxPoolTransactions() << " ) ..."; } } else if(state == POOL_STATUS_SIGNING) { if(showingDarkSendMessage % 70 <= 10) convert << "Found enough users, signing"; diff --git a/src/test/darksend_tests.cpp b/src/test/darksend_tests.cpp index 4388162581..28caa90201 100644 --- a/src/test/darksend_tests.cpp +++ b/src/test/darksend_tests.cpp @@ -114,9 +114,9 @@ BOOST_AUTO_TEST_CASE(darksend_session) BOOST_CHECK(darkSendPool.IsCompatibleWithSession(151*COIN) == false); BOOST_CHECK(darkSendPool.IsCompatibleWithSession(751*COIN) == false); BOOST_CHECK(darkSendPool.IsCompatibleWithSession(531*COIN)); - if(POOL_MAX_TRANSACTIONS >= 3) BOOST_CHECK(darkSendPool.IsCompatibleWithSession(551*COIN)); - if(POOL_MAX_TRANSACTIONS >= 4) BOOST_CHECK(darkSendPool.IsCompatibleWithSession(571*COIN)); - if(POOL_MAX_TRANSACTIONS >= 5) BOOST_CHECK(darkSendPool.IsCompatibleWithSession(514*COIN)); + if(darkSendPool.GetMaxPoolTransactions() >= 3) BOOST_CHECK(darkSendPool.IsCompatibleWithSession(551*COIN)); + if(darkSendPool.GetMaxPoolTransactions() >= 4) BOOST_CHECK(darkSendPool.IsCompatibleWithSession(571*COIN)); + if(darkSendPool.GetMaxPoolTransactions() >= 5) BOOST_CHECK(darkSendPool.IsCompatibleWithSession(514*COIN)); BOOST_CHECK(darkSendPool.IsCompatibleWithSession(531*COIN) == false); darkSendPool.SetNull(); @@ -126,9 +126,9 @@ BOOST_AUTO_TEST_CASE(darksend_session) BOOST_CHECK(darkSendPool.IsCompatibleWithSession(151*COIN) == false); BOOST_CHECK(darkSendPool.IsCompatibleWithSession(751*COIN) == false); BOOST_CHECK(darkSendPool.IsCompatibleWithSession(34*COIN)); - if(POOL_MAX_TRANSACTIONS >= 3) BOOST_CHECK(darkSendPool.IsCompatibleWithSession(22*COIN)); - if(POOL_MAX_TRANSACTIONS >= 4) BOOST_CHECK(darkSendPool.IsCompatibleWithSession(32*COIN)); - if(POOL_MAX_TRANSACTIONS >= 5) BOOST_CHECK(darkSendPool.IsCompatibleWithSession(44*COIN)); + if(darkSendPool.GetMaxPoolTransactions() >= 3) BOOST_CHECK(darkSendPool.IsCompatibleWithSession(22*COIN)); + if(darkSendPool.GetMaxPoolTransactions() >= 4) BOOST_CHECK(darkSendPool.IsCompatibleWithSession(32*COIN)); + if(darkSendPool.GetMaxPoolTransactions() >= 5) BOOST_CHECK(darkSendPool.IsCompatibleWithSession(44*COIN)); BOOST_CHECK(darkSendPool.IsCompatibleWithSession(33*COIN) == false); }