Skip to content

Commit

Permalink
liquidity providers
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Duffield committed Oct 23, 2014
1 parent cfddcc4 commit d6431b3
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 10
#define CLIENT_VERSION_REVISION 16
#define CLIENT_VERSION_BUILD 0
#define CLIENT_VERSION_BUILD 1

// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
Expand Down
13 changes: 8 additions & 5 deletions src/darksend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1522,8 +1522,8 @@ bool CDarkSendPool::DoAutomaticDenominating(bool fDryRun, bool ready)
if(fMasterNode) return false;
if(state == POOL_STATUS_ERROR || state == POOL_STATUS_SUCCESS) return false;

if(nBestHeight == cachedLastSuccess) {
LogPrintf("CDarkSendPool::DoAutomaticDenominating - Last successful ds+ was too recent\n");
if(nBestHeight-cachedLastSuccess < nDarksendBlocksBetweenSuccesses) {
LogPrintf("CDarkSendPool::DoAutomaticDenominating - Last successful darksend was too recent\n");
return false;
}
if(!fEnableDarksend) {
Expand Down Expand Up @@ -1731,7 +1731,7 @@ bool CDarkSendPool::SplitUpMoney(bool justCollateral)

LogPrintf("DoAutomaticDenominating: Split up large input (justCollateral %d):\n", justCollateral);
LogPrintf(" -- nTotalBalance %"PRI64d"\n", nTotalBalance);
LogPrintf(" -- denom %"PRI64d" \n", pwalletMain->GetDenominatedBalance(false));
LogPrintf(" -- non-denom %"PRI64d" \n", pwalletMain->GetDenominatedBalance(false));

// make our change address
CReserveKey reservekey(pwalletMain);
Expand All @@ -1752,18 +1752,19 @@ bool CDarkSendPool::SplitUpMoney(bool justCollateral)
vecSend.push_back(make_pair(scriptChange, (DARKSEND_COLLATERAL*5)+DARKSEND_FEE));
nTotalOut += (DARKSEND_COLLATERAL*5)+DARKSEND_FEE;

for(int d = 0; d <= 4+nDarksendRounds; d++){
for(int d = 0; d <= std::min(4+nDarksendRounds,20); d++){
vecSend.push_back(make_pair(scriptChange, DARKSEND_FEE));
nTotalOut += DARKSEND_FEE;
}


// ****** Add outputs in bases of two from 1 darkcoin *** /
if(!justCollateral){
bool continuing = true;

while(continuing){
if(nTotalOut + a < nTotalBalance-DARKSEND_FEE){
//LogPrintf(" nTotalOut %"PRI64d", added %"PRI64d"\n", nTotalOut, a);
LogPrintf("SplitUpMoney: nTotalOut %"PRI64d", added %"PRI64d"\n", nTotalOut, a);

vecSend.push_back(make_pair(scriptChange, a));
nTotalOut += a;
Expand All @@ -1775,6 +1776,8 @@ bool CDarkSendPool::SplitUpMoney(bool justCollateral)
}
}

LogPrintf(" -- nTotalOut %"PRI64d" \n", nTotalOut);

if((justCollateral && nTotalOut <= 0.1*COIN) || vecSend.size() < 3) {
LogPrintf("SplitUpMoney: Not enough outputs to make a transaction\n");
return false;
Expand Down
6 changes: 5 additions & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,11 @@ bool AppInit2(boost::thread_group& threadGroup)
fEnableDarksend = GetBoolArg("-enabledarksend", false);

nDarksendRounds = GetArg("-darksendrounds", 2);
if(nDarksendRounds > 8) nDarksendRounds = 8;
if(nDarksendRounds > 99999) nDarksendRounds = 99999;
if(nDarksendRounds < 1) nDarksendRounds = 1;

nDarksendBlocksBetweenSuccesses = GetArg("-darksend_blocks_between_successes", 1);
if(nDarksendRounds > 99999) nDarksendRounds = 99999;
if(nDarksendRounds < 1) nDarksendRounds = 1;

nAnonymizeDarkcoinAmount = GetArg("-anonymizedarkcoinamount", 0);
Expand Down
1 change: 1 addition & 0 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ string strMasterNodePrivKey = "";
string strMasterNodeAddr = "";
int nDarksendRounds = 2;
int nAnonymizeDarkcoinAmount = 1000;
int nDarksendBlocksBetweenSuccesses = 1;
/** Spork enforcement enabled time */
int64 enforceMasternodePaymentsTime = 4085657524;
bool fSucessfullyLoaded = false;
Expand Down
1 change: 1 addition & 0 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ extern std::map<std::string, std::string> mapArgs;
extern std::map<std::string, std::vector<std::string> > mapMultiArgs;
extern bool fMasterNode;
extern int nDarksendRounds;
extern int nDarksendBlocksBetweenSuccesses;
extern int nAnonymizeDarkcoinAmount;
extern bool fEnableDarksend;
extern int64 enforceMasternodePaymentsTime;
Expand Down

0 comments on commit d6431b3

Please sign in to comment.