From 3f65877f192e27172304016b02582516229f3d83 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Fri, 28 Nov 2014 09:17:33 -0700 Subject: [PATCH] changeless darksend with new micro denom --- src/darksend.cpp | 11 +++++++++-- src/darksend.h | 5 +++-- src/version.h | 2 +- src/wallet.cpp | 6 +++--- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/darksend.cpp b/src/darksend.cpp index c54e44c29f..462361740e 100644 --- a/src/darksend.cpp +++ b/src/darksend.cpp @@ -247,6 +247,13 @@ void ProcessMessageDarksend(CNode* pfrom, std::string& strCommand, CDataStream& } } + if (nValueIn > DARKSEND_POOL_MAX) { + LogPrintf("dsi -- more than darksend pool max! %s\n", tx.ToString().c_str()); + error = "more than darksed pool max"; + pfrom->PushMessage("dssu", darkSendPool.sessionID, darkSendPool.GetState(), darkSendPool.GetEntriesCount(), MASTERNODE_REJECTED, error); + return; + } + if(!missingTx){ if (nValueIn-nValueOut > nValueIn*.01) { LogPrintf("dsi -- fees are too high! %s\n", tx.ToString().c_str()); @@ -1369,10 +1376,10 @@ bool CDarkSendPool::DoAutomaticDenominating(bool fDryRun, bool ready) // ** find the coins we'll use std::vector vCoins; int64 nValueMin = 0.01*COIN; - int64 nValueMax = 999*COIN; + int64 nValueMax = DARKSEND_POOL_MAX; int64 nValueIn = 0; int minRounds = -2; //non denominated funds are rounds of less than 0 - int maxAmount = 1000; + int maxAmount = 300; bool hasFeeInput = false; // if we have more denominated funds (of any maturity) than the nAnonymizeDarkcoinAmount, we should use use those diff --git a/src/darksend.h b/src/darksend.h index 61f3cc32a9..3e7f6dac5c 100644 --- a/src/darksend.h +++ b/src/darksend.h @@ -43,7 +43,8 @@ extern std::vector vecDarksendQueue; extern std::string strMasterNodePrivKey; static const int64 DARKSEND_COLLATERAL = (0.1*COIN); -static const int64 DARKSEND_FEE = 0.0125*COIN; +static const int64 DARKSEND_FEE = (0.0125*COIN); +static const int64 DARKSEND_POOL_MAX = (299.99*COIN); //specific messages for the Darksend protocol void ProcessMessageDarksend(CNode* pfrom, std::string& strCommand, CDataStream& vRecv); @@ -212,7 +213,7 @@ class CDarksendSession class CDarkSendPool { public: - static const int MIN_PEER_PROTO_VERSION = 70046; + static const int MIN_PEER_PROTO_VERSION = 70047; // clients entries std::vector myEntries; diff --git a/src/version.h b/src/version.h index 0f7d895c3f..f460693bf3 100644 --- a/src/version.h +++ b/src/version.h @@ -25,7 +25,7 @@ extern const std::string CLIENT_DATE; // network protocol versioning // -static const int PROTOCOL_VERSION = 70046; +static const int PROTOCOL_VERSION = 70047; // intial proto version, to be increased after version/verack negotiation static const int INIT_PROTO_VERSION = 209; diff --git a/src/wallet.cpp b/src/wallet.cpp index f6639825ff..7ad56b81ac 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1891,11 +1891,11 @@ string CWallet::PrepareDarksendDenominate(int minRounds, int64 maxAmount) std::vector vOut; int nOutputs = 0; - // Make outputs by looping through denominations, from large to small - BOOST_FOREACH(int64 v, darkSendDenominations){ + // Make outputs by looping through denominations, from small to large + BOOST_REVERSE_FOREACH(int64 v, darkSendDenominations){ nOutputs = 0; // add each output up to 10 times until it can't be added again - while(nValueLeft - v >= 0 && nOutputs <= 10) { + while(nValueLeft - v >= 0 && nOutputs <= 20) { CScript scriptChange; CPubKey vchPubKey; //use a unique change address