changeless darksend with new micro denom

This commit is contained in:
Evan Duffield 2014-11-28 09:17:33 -07:00
parent db4c78747d
commit 3f65877f19
4 changed files with 16 additions and 8 deletions

View File

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

View File

@ -43,7 +43,8 @@ extern std::vector<CDarksendQueue> 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<CDarkSendEntry> myEntries;

View File

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

View File

@ -1891,11 +1891,11 @@ string CWallet::PrepareDarksendDenominate(int minRounds, int64 maxAmount)
std::vector<CTxOut> 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