This commit is contained in:
Evan Duffield 2014-09-13 06:33:13 -07:00
parent 355c1d3eee
commit 15683a8d9e
5 changed files with 31 additions and 20 deletions

View File

@ -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

View File

@ -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<CTxIn>& 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;
}

View File

@ -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<CTxOut> vout);
// Is this amount compatible with other client in the pool?

View File

@ -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";

View File

@ -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);
}