diff --git a/src/darksend.cpp b/src/darksend.cpp index a2bafb2e90..fe8a76ff4f 100644 --- a/src/darksend.cpp +++ b/src/darksend.cpp @@ -132,7 +132,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand } if(state == POOL_STATUS_QUEUE){ - LogPrint("darksend", "PrivateSend queue is ready - %s\n", addr.ToString()); + LogPrint("privatesend", "PrivateSend queue is ready - %s\n", addr.ToString()); PrepareDarksendDenominate(); } } else { @@ -140,18 +140,18 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand if(q.vin == dsq.vin) return; } - LogPrint("darksend", "dsq last %d last2 %d count %d\n", pmn->nLastDsq, pmn->nLastDsq + mnodeman.size()/5, mnodeman.nDsqCount); + LogPrint("privatesend", "dsq last %d last2 %d count %d\n", pmn->nLastDsq, pmn->nLastDsq + mnodeman.size()/5, mnodeman.nDsqCount); //don't allow a few nodes to dominate the queuing process if(pmn->nLastDsq != 0 && pmn->nLastDsq + mnodeman.CountEnabled(MIN_POOL_PEER_PROTO_VERSION)/5 > mnodeman.nDsqCount){ - LogPrint("darksend", "dsq -- Masternode sending too many dsq messages. %s \n", pmn->addr.ToString()); + LogPrint("privatesend", "dsq -- Masternode sending too many dsq messages. %s \n", pmn->addr.ToString()); return; } mnodeman.nDsqCount++; pmn->nLastDsq = mnodeman.nDsqCount; pmn->allowFreeTx = true; - LogPrint("darksend", "dsq - new PrivateSend queue object - %s\n", addr.ToString()); + LogPrint("privatesend", "dsq - new PrivateSend queue object - %s\n", addr.ToString()); vecDarksendQueue.push_back(dsq); dsq.Relay(); dsq.time = GetTime(); @@ -228,7 +228,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand BOOST_FOREACH(const CTxIn i, in){ tx.vin.push_back(i); - LogPrint("darksend", "dsi -- tx in %s\n", i.ToString()); + LogPrint("privatesend", "dsi -- tx in %s\n", i.ToString()); CTransaction tx2; uint256 hash; @@ -302,7 +302,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand int errorID; vRecv >> sessionIDMessage >> state >> entriesCount >> accepted >> errorID; - LogPrint("darksend", "dssu - state: %i entriesCount: %i accepted: %i error: %s \n", state, entriesCount, accepted, GetMessageByID(errorID)); + LogPrint("privatesend", "dssu - state: %i entriesCount: %i accepted: %i error: %s \n", state, entriesCount, accepted, GetMessageByID(errorID)); if((accepted != 1 && accepted != 0) && sessionID != sessionIDMessage){ LogPrintf("dssu - message doesn't match current PrivateSend session %d %d\n", sessionID, sessionIDMessage); @@ -331,14 +331,14 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand success = false; break; } - LogPrint("darksend", "DSSIGNFINALTX - AddScriptSig %d/%d - success\n", nSigIndex, nSigsCount); + LogPrint("privatesend", "DSSIGNFINALTX - AddScriptSig %d/%d - success\n", nSigIndex, nSigsCount); } if(success){ Check(); RelayStatus(sessionID, GetState(), GetEntriesCount(), MASTERNODE_RESET); } else { - LogPrint("darksend", "DSSIGNFINALTX - AddScriptSig failed at %d/%d, session %d\n", nSigIndex, nSigsCount, sessionID); + LogPrint("privatesend", "DSSIGNFINALTX - AddScriptSig failed at %d/%d, session %d\n", nSigIndex, nSigsCount, sessionID); } } else if (strCommand == NetMsgType::DSFINALTX) { //Darksend Final tx if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) { @@ -356,7 +356,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand vRecv >> sessionIDMessage >> txNew; if(sessionID != sessionIDMessage){ - LogPrint("darksend", "dsf - message doesn't match current PrivateSend session %d %d\n", sessionID, sessionIDMessage); + LogPrint("privatesend", "dsf - message doesn't match current PrivateSend session %d %d\n", sessionID, sessionIDMessage); return; } @@ -381,7 +381,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand vRecv >> sessionIDMessage >> error >> errorID; if(sessionID != sessionIDMessage){ - LogPrint("darksend", "dsc - message doesn't match current PrivateSend session %d %d\n", darkSendPool.sessionID, sessionIDMessage); + LogPrint("privatesend", "dsc - message doesn't match current PrivateSend session %d %d\n", darkSendPool.sessionID, sessionIDMessage); return; } @@ -511,23 +511,23 @@ std::string CDarksendPool::GetStatus() // void CDarksendPool::Check() { - if(fMasterNode) LogPrint("darksend", "CDarksendPool::Check() - entries count %lu\n", entries.size()); + if(fMasterNode) LogPrint("privatesend", "CDarksendPool::Check() - entries count %lu\n", entries.size()); //printf("CDarksendPool::Check() %d - %d - %d\n", state, anonTx.CountEntries(), GetTimeMillis()-lastTimeChanged); if(fMasterNode) { - LogPrint("darksend", "CDarksendPool::Check() - entries count %lu\n", entries.size()); + LogPrint("privatesend", "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 && (int)entries.size() >= GetMaxPoolTransactions()) { - LogPrint("darksend", "CDarksendPool::Check() -- TRYING TRANSACTION \n"); + LogPrint("privatesend", "CDarksendPool::Check() -- TRYING TRANSACTION \n"); UpdateState(POOL_STATUS_FINALIZE_TRANSACTION); } } // create the finalized transaction for distribution to the clients if(state == POOL_STATUS_FINALIZE_TRANSACTION) { - LogPrint("darksend", "CDarksendPool::Check() -- FINALIZE TRANSACTIONS\n"); + LogPrint("privatesend", "CDarksendPool::Check() -- FINALIZE TRANSACTIONS\n"); UpdateState(POOL_STATUS_SIGNING); if (fMasterNode) { @@ -547,7 +547,7 @@ void CDarksendPool::Check() sort(txNew.vout.begin(), txNew.vout.end()); - LogPrint("darksend", "Transaction 1: %s\n", txNew.ToString()); + LogPrint("privatesend", "Transaction 1: %s\n", txNew.ToString()); finalMutableTransaction = txNew; // request signatures from clients @@ -557,7 +557,7 @@ void CDarksendPool::Check() // If we have all of the signatures, try to compile the transaction if(fMasterNode && state == POOL_STATUS_SIGNING && SignaturesComplete()) { - LogPrint("darksend", "CDarksendPool::Check() -- SIGNING\n"); + LogPrint("privatesend", "CDarksendPool::Check() -- SIGNING\n"); UpdateState(POOL_STATUS_TRANSMISSION); CheckFinalTransaction(); @@ -565,7 +565,7 @@ void CDarksendPool::Check() // reset if we're here for 10 seconds if((state == POOL_STATUS_ERROR || state == POOL_STATUS_SUCCESS) && GetTimeMillis()-lastTimeChanged >= 10000) { - LogPrint("darksend", "CDarksendPool::Check() -- timeout, RESETTING\n"); + LogPrint("privatesend", "CDarksendPool::Check() -- timeout, RESETTING\n"); UnlockCoins(); SetNull(); if(fMasterNode) RelayStatus(sessionID, GetState(), GetEntriesCount(), MASTERNODE_RESET); @@ -578,7 +578,7 @@ void CDarksendPool::CheckFinalTransaction() CTransaction finalTransaction = CTransaction(finalMutableTransaction); - LogPrint("darksend", "Transaction 2: %s\n", finalTransaction.ToString()); + LogPrint("privatesend", "Transaction 2: %s\n", finalTransaction.ToString()); { // See if the transaction is valid @@ -643,7 +643,7 @@ void CDarksendPool::CheckFinalTransaction() ChargeRandomFees(); // Reset - LogPrint("darksend", "CDarksendPool::Check() -- COMPLETED -- RESETTING\n"); + LogPrint("privatesend", "CDarksendPool::Check() -- COMPLETED -- RESETTING\n"); SetNull(); RelayStatus(sessionID, GetState(), GetEntriesCount(), MASTERNODE_RESET); } @@ -808,27 +808,27 @@ void CDarksendPool::CheckTimeout(){ vector::iterator it = vecDarksendQueue.begin(); while(it != vecDarksendQueue.end()){ if((*it).IsExpired()){ - LogPrint("darksend", "CDarksendPool::CheckTimeout() : Removing expired queue entry - %d\n", c); + LogPrint("privatesend", "CDarksendPool::CheckTimeout() : Removing expired queue entry - %d\n", c); it = vecDarksendQueue.erase(it); } else ++it; c++; } - if(!fEnableDarksend && !fMasterNode) return; + if(!fEnablePrivateSend && !fMasterNode) return; // catching hanging sessions if(!fMasterNode) { switch(state) { case POOL_STATUS_TRANSMISSION: - LogPrint("darksend", "CDarksendPool::CheckTimeout() -- Session complete -- Running Check()\n"); + LogPrint("privatesend", "CDarksendPool::CheckTimeout() -- Session complete -- Running Check()\n"); Check(); break; case POOL_STATUS_ERROR: - LogPrint("darksend", "CDarksendPool::CheckTimeout() -- Pool error -- Running Check()\n"); + LogPrint("privatesend", "CDarksendPool::CheckTimeout() -- Pool error -- Running Check()\n"); Check(); break; case POOL_STATUS_SUCCESS: - LogPrint("darksend", "CDarksendPool::CheckTimeout() -- Pool success -- Running Check()\n"); + LogPrint("privatesend", "CDarksendPool::CheckTimeout() -- Pool success -- Running Check()\n"); Check(); break; } @@ -844,7 +844,7 @@ void CDarksendPool::CheckTimeout(){ vector::iterator it2 = entries.begin(); while(it2 != entries.end()){ if((*it2).IsExpired()){ - LogPrint("darksend", "CDarksendPool::CheckTimeout() : Removing expired entry - %d\n", c); + LogPrint("privatesend", "CDarksendPool::CheckTimeout() : Removing expired entry - %d\n", c); it2 = entries.erase(it2); if(entries.size() == 0){ UnlockCoins(); @@ -862,7 +862,7 @@ void CDarksendPool::CheckTimeout(){ SetNull(); } } else if(GetTimeMillis()-lastTimeChanged >= (DARKSEND_QUEUE_TIMEOUT*1000)+addLagTime){ - LogPrint("darksend", "CDarksendPool::CheckTimeout() -- Session timed out (%ds) -- resetting\n", DARKSEND_QUEUE_TIMEOUT); + LogPrint("privatesend", "CDarksendPool::CheckTimeout() -- Session timed out (%ds) -- resetting\n", DARKSEND_QUEUE_TIMEOUT); UnlockCoins(); SetNull(); @@ -871,7 +871,7 @@ void CDarksendPool::CheckTimeout(){ } if(state == POOL_STATUS_SIGNING && GetTimeMillis()-lastTimeChanged >= (DARKSEND_SIGNING_TIMEOUT*1000)+addLagTime ) { - LogPrint("darksend", "CDarksendPool::CheckTimeout() -- Session timed out (%ds) -- restting\n", DARKSEND_SIGNING_TIMEOUT); + LogPrint("privatesend", "CDarksendPool::CheckTimeout() -- Session timed out (%ds) -- restting\n", DARKSEND_SIGNING_TIMEOUT); ChargeFees(); UnlockCoins(); SetNull(); @@ -885,7 +885,7 @@ void CDarksendPool::CheckTimeout(){ // Check for complete queue // void CDarksendPool::CheckForCompleteQueue(){ - if(!fEnableDarksend && !fMasterNode) return; + if(!fEnablePrivateSend && !fMasterNode) return; /* Check to see if we're ready for submissions from clients */ // @@ -933,14 +933,14 @@ bool CDarksendPool::SignatureValid(const CScript& newSig, const CTxIn& newVin){ if(found >= 0){ //might have to do this one input at a time? int n = found; txNew.vin[n].scriptSig = newSig; - LogPrint("darksend", "CDarksendPool::SignatureValid() - Sign with sig %s\n", ScriptToAsmStr(newSig).substr(0,24)); + LogPrint("privatesend", "CDarksendPool::SignatureValid() - Sign with sig %s\n", ScriptToAsmStr(newSig).substr(0,24)); if (!VerifyScript(txNew.vin[n].scriptSig, sigPubKey, SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC, MutableTransactionSignatureChecker(&txNew, n))){ - LogPrint("darksend", "CDarksendPool::SignatureValid() - Signing - Error signing input %u\n", n); + LogPrint("privatesend", "CDarksendPool::SignatureValid() - Signing - Error signing input %u\n", n); return false; } } - LogPrint("darksend", "CDarksendPool::SignatureValid() - Signing - Successfully validated input\n"); + LogPrint("privatesend", "CDarksendPool::SignatureValid() - Signing - Successfully validated input\n"); return true; } @@ -975,17 +975,17 @@ bool CDarksendPool::IsCollateralValid(const CTransaction& txCollateral){ } if(missingTx){ - LogPrint("darksend", "CDarksendPool::IsCollateralValid - Unknown inputs in collateral transaction - %s", txCollateral.ToString()); + LogPrint("privatesend", "CDarksendPool::IsCollateralValid - Unknown inputs in collateral transaction - %s", txCollateral.ToString()); return false; } //collateral transactions are required to pay out DARKSEND_COLLATERAL as a fee to the miners if(nValueIn - nValueOut < DARKSEND_COLLATERAL) { - LogPrint("darksend", "CDarksendPool::IsCollateralValid - did not include enough fees in transaction %d\n%s", nValueOut-nValueIn, txCollateral.ToString()); + LogPrint("privatesend", "CDarksendPool::IsCollateralValid - did not include enough fees in transaction %d\n%s", nValueOut-nValueIn, txCollateral.ToString()); return false; } - LogPrint("darksend", "CDarksendPool::IsCollateralValid %s", txCollateral.ToString()); + LogPrint("privatesend", "CDarksendPool::IsCollateralValid %s", txCollateral.ToString()); { LOCK(cs_main); @@ -1008,7 +1008,7 @@ bool CDarksendPool::AddEntry(const std::vector& newInput, const CAmount& BOOST_FOREACH(CTxIn in, newInput) { if (in.prevout.IsNull() || nAmount < 0) { - LogPrint("darksend", "CDarksendPool::AddEntry - input not valid!\n"); + LogPrint("privatesend", "CDarksendPool::AddEntry - input not valid!\n"); errorID = ERR_INVALID_INPUT; sessionUsers--; return false; @@ -1016,25 +1016,25 @@ bool CDarksendPool::AddEntry(const std::vector& newInput, const CAmount& } if (!IsCollateralValid(txCollateral)){ - LogPrint("darksend", "CDarksendPool::AddEntry - collateral not valid!\n"); + LogPrint("privatesend", "CDarksendPool::AddEntry - collateral not valid!\n"); errorID = ERR_INVALID_COLLATERAL; sessionUsers--; return false; } if((int)entries.size() >= GetMaxPoolTransactions()){ - LogPrint("darksend", "CDarksendPool::AddEntry - entries is full!\n"); + LogPrint("privatesend", "CDarksendPool::AddEntry - entries is full!\n"); errorID = ERR_ENTRIES_FULL; sessionUsers--; return false; } BOOST_FOREACH(CTxIn in, newInput) { - LogPrint("darksend", "looking for vin -- %s\n", in.ToString()); + LogPrint("privatesend", "looking for vin -- %s\n", in.ToString()); BOOST_FOREACH(const CDarkSendEntry& v, entries) { BOOST_FOREACH(const CTxDSIn& s, v.sev){ if((CTxIn)s == in) { - LogPrint("darksend", "CDarksendPool::AddEntry - found in vin\n"); + LogPrint("privatesend", "CDarksendPool::AddEntry - found in vin\n"); errorID = ERR_ALREADY_HAVE; sessionUsers--; return false; @@ -1047,42 +1047,42 @@ bool CDarksendPool::AddEntry(const std::vector& newInput, const CAmount& v.Add(newInput, nAmount, txCollateral, newOutput); entries.push_back(v); - LogPrint("darksend", "CDarksendPool::AddEntry -- adding %s\n", newInput[0].ToString()); + LogPrint("privatesend", "CDarksendPool::AddEntry -- adding %s\n", newInput[0].ToString()); errorID = MSG_ENTRIES_ADDED; return true; } bool CDarksendPool::AddScriptSig(const CTxIn& newVin){ - LogPrint("darksend", "CDarksendPool::AddScriptSig -- new sig %s\n", ScriptToAsmStr(newVin.scriptSig).substr(0,24)); + LogPrint("privatesend", "CDarksendPool::AddScriptSig -- new sig %s\n", ScriptToAsmStr(newVin.scriptSig).substr(0,24)); BOOST_FOREACH(const CDarkSendEntry& v, entries) { BOOST_FOREACH(const CTxDSIn& s, v.sev){ if(s.scriptSig == newVin.scriptSig) { - LogPrint("darksend", "CDarksendPool::AddScriptSig - already exists\n"); + LogPrint("privatesend", "CDarksendPool::AddScriptSig - already exists\n"); return false; } } } if(!SignatureValid(newVin.scriptSig, newVin)){ - LogPrint("darksend", "CDarksendPool::AddScriptSig - Invalid Sig\n"); + LogPrint("privatesend", "CDarksendPool::AddScriptSig - Invalid Sig\n"); return false; } - LogPrint("darksend", "CDarksendPool::AddScriptSig -- sig %s\n", ScriptToAsmStr(newVin.scriptSig)); + LogPrint("privatesend", "CDarksendPool::AddScriptSig -- sig %s\n", ScriptToAsmStr(newVin.scriptSig)); BOOST_FOREACH(CTxIn& vin, finalMutableTransaction.vin){ if(newVin.prevout == vin.prevout && vin.nSequence == newVin.nSequence){ vin.scriptSig = newVin.scriptSig; vin.prevPubKey = newVin.prevPubKey; - LogPrint("darksend", "CDarksendPool::AddScriptSig -- adding to finalMutableTransaction %s\n", ScriptToAsmStr(newVin.scriptSig).substr(0,24)); + LogPrint("privatesend", "CDarksendPool::AddScriptSig -- adding to finalMutableTransaction %s\n", ScriptToAsmStr(newVin.scriptSig).substr(0,24)); } } for(unsigned int i = 0; i < entries.size(); i++){ if(entries[i].AddSig(newVin)){ - LogPrint("darksend", "CDarksendPool::AddScriptSig -- adding %s\n", ScriptToAsmStr(newVin.scriptSig).substr(0,24)); + LogPrint("privatesend", "CDarksendPool::AddScriptSig -- adding %s\n", ScriptToAsmStr(newVin.scriptSig).substr(0,24)); return true; } } @@ -1139,7 +1139,7 @@ void CDarksendPool::SendDarksendDenominate(std::vector& vin, std::vector< if (!CheckDiskSpace()) { UnlockCoins(); SetNull(); - fEnableDarksend = false; + fEnablePrivateSend = false; LogPrintf("CDarksendPool::SendDarksendDenominate() - Not enough disk space, disabling PrivateSend.\n"); return; } @@ -1165,7 +1165,7 @@ void CDarksendPool::SendDarksendDenominate(std::vector& vin, std::vector< BOOST_FOREACH(const CTxIn& i, vin){ tx.vin.push_back(i); - LogPrint("darksend", "CDarksendPool::SendDarksendDenominate() -- tx in %s\n", i.ToString()); + LogPrint("privatesend", "CDarksendPool::SendDarksendDenominate() -- tx in %s\n", i.ToString()); } LogPrintf("Submitting tx %s\n", tx.ToString()); @@ -1295,19 +1295,19 @@ bool CDarksendPool::SignFinalTransaction(CTransaction& finalTransactionNew, CNod const CKeyStore& keystore = *pwalletMain; - LogPrint("darksend", "CDarksendPool::Sign - Signing my input %i\n", mine); + LogPrint("privatesend", "CDarksendPool::Sign - Signing my input %i\n", mine); if(!SignSignature(keystore, prevPubKey, finalMutableTransaction, mine, int(SIGHASH_ALL|SIGHASH_ANYONECANPAY))) { // changes scriptSig - LogPrint("darksend", "CDarksendPool::Sign - Unable to sign my own transaction! \n"); + LogPrint("privatesend", "CDarksendPool::Sign - Unable to sign my own transaction! \n"); // not sure what to do here, it will timeout...? } sigs.push_back(finalMutableTransaction.vin[mine]); - LogPrint("darksend", " -- dss %d %d %s\n", mine, (int)sigs.size(), ScriptToAsmStr(finalMutableTransaction.vin[mine].scriptSig)); + LogPrint("privatesend", " -- dss %d %d %s\n", mine, (int)sigs.size(), ScriptToAsmStr(finalMutableTransaction.vin[mine].scriptSig)); } } - LogPrint("darksend", "CDarksendPool::Sign - txNew:\n%s", finalMutableTransaction.ToString()); + LogPrint("privatesend", "CDarksendPool::Sign - txNew:\n%s", finalMutableTransaction.ToString()); } // push all of our signatures to the Masternode @@ -1320,7 +1320,7 @@ bool CDarksendPool::SignFinalTransaction(CTransaction& finalTransactionNew, CNod void CDarksendPool::NewBlock() { - LogPrint("darksend", "CDarksendPool::NewBlock \n"); + LogPrint("privatesend", "CDarksendPool::NewBlock \n"); //we we're processing lots of blocks, we'll just leave if(GetTime() - lastNewBlock < 10) return; @@ -1366,7 +1366,7 @@ void CDarksendPool::ClearLastMessage() // bool CDarksendPool::DoAutomaticDenominating(bool fDryRun) { - if(!fEnableDarksend) return false; + if(!fEnablePrivateSend) return false; if(fMasterNode) return false; if(!pCurrentBlockIndex) return false; @@ -1393,14 +1393,14 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun) return false; } - if(!fDarksendMultiSession && pCurrentBlockIndex->nHeight - cachedLastSuccess < minBlockSpacing) { + if(!fPrivateSendMultiSession && pCurrentBlockIndex->nHeight - cachedLastSuccess < minBlockSpacing) { LogPrintf("CDarksendPool::DoAutomaticDenominating - Last successful PrivateSend action was too recent\n"); strAutoDenomResult = _("Last successful PrivateSend action was too recent."); return false; } if(mnodeman.size() == 0){ - LogPrint("darksend", "CDarksendPool::DoAutomaticDenominating - No Masternodes detected\n"); + LogPrint("privatesend", "CDarksendPool::DoAutomaticDenominating - No Masternodes detected\n"); strAutoDenomResult = _("No Masternodes detected."); return false; } @@ -1441,10 +1441,10 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun) // not enough funds to anonymze amount we want, try the max we can if(nBalanceNeedsAnonymized > nAnonymizableBalance) nBalanceNeedsAnonymized = nAnonymizableBalance; - LogPrint("darksend", "DoAutomaticDenominating : nLowestDenom=%d, nBalanceNeedsAnonymized=%d\n", nLowestDenom, nBalanceNeedsAnonymized); + LogPrint("privatesend", "DoAutomaticDenominating : nLowestDenom=%d, nBalanceNeedsAnonymized=%d\n", nLowestDenom, nBalanceNeedsAnonymized); // select coins that should be given to the pool - if (!pwalletMain->SelectCoinsDark(nValueMin, nBalanceNeedsAnonymized, vCoins, nValueIn, 0, nDarksendRounds)) + if (!pwalletMain->SelectCoinsDark(nValueMin, nBalanceNeedsAnonymized, vCoins, nValueIn, 0, nPrivateSendRounds)) { nValueIn = 0; vCoins.clear(); @@ -1490,7 +1490,7 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun) int nUseQueue = rand()%100; UpdateState(POOL_STATUS_ACCEPTING_ENTRIES); - if(!fDarksendMultiSession && pwalletMain->GetDenominatedBalance(true) > 0) { //get denominated unconfirmed inputs + if(!fPrivateSendMultiSession && pwalletMain->GetDenominatedBalance(true) > 0) { //get denominated unconfirmed inputs LogPrintf("DoAutomaticDenominating -- Found unconfirmed denominated outputs, will wait till they confirm to continue.\n"); strAutoDenomResult = _("Found unconfirmed denominated outputs, will wait till they confirm to continue."); return false; @@ -1515,10 +1515,10 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun) //if we've used 90% of the Masternode list then drop all the oldest first int nThreshold = (int)(mnodeman.CountEnabled(MIN_POOL_PEER_PROTO_VERSION) * 0.9); - LogPrint("darksend", "Checking vecMasternodesUsed size %d threshold %d\n", (int)vecMasternodesUsed.size(), nThreshold); + LogPrint("privatesend", "Checking vecMasternodesUsed size %d threshold %d\n", (int)vecMasternodesUsed.size(), nThreshold); while((int)vecMasternodesUsed.size() > nThreshold){ vecMasternodesUsed.erase(vecMasternodesUsed.begin()); - LogPrint("darksend", " vecMasternodesUsed size %d threshold %d\n", (int)vecMasternodesUsed.size(), nThreshold); + LogPrint("privatesend", " vecMasternodesUsed size %d threshold %d\n", (int)vecMasternodesUsed.size(), nThreshold); } // don't use the queues all of the time for mixing unless we are a liquidity provider @@ -1552,7 +1552,7 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun) std::vector vTempCoins; std::vector vTempCoins2; // Try to match their denominations if possible - if (!pwalletMain->SelectCoinsByDenominations(dsq.nDenom, nValueMin, nBalanceNeedsAnonymized, vTempCoins, vTempCoins2, nValueIn, 0, nDarksendRounds)){ + if (!pwalletMain->SelectCoinsByDenominations(dsq.nDenom, nValueMin, nBalanceNeedsAnonymized, vTempCoins, vTempCoins2, nValueIn, 0, nPrivateSendRounds)){ LogPrintf("DoAutomaticDenominating --- Couldn't match denominations %d\n", dsq.nDenom); continue; } @@ -1648,14 +1648,14 @@ bool CDarksendPool::PrepareDarksendDenominate() std::string strError = ""; // Submit transaction to the pool if we get here // Try to use only inputs with the same number of rounds starting from lowest number of rounds possible - for(int i = 0; i < nDarksendRounds; i++) { + for(int i = 0; i < nPrivateSendRounds; i++) { strError = pwalletMain->PrepareDarksendDenominate(i, i+1); LogPrintf("DoAutomaticDenominating : Running PrivateSend denominate for %d rounds. Return '%s'\n", i, strError); if(strError == "") return true; } // We failed? That's strange but let's just make final attempt and try to mix everything - strError = pwalletMain->PrepareDarksendDenominate(0, nDarksendRounds); + strError = pwalletMain->PrepareDarksendDenominate(0, nPrivateSendRounds); LogPrintf("DoAutomaticDenominating : Running PrivateSend denominate for all rounds. Return '%s'\n", strError); if(strError == "") return true; @@ -1846,7 +1846,7 @@ bool CDarksendPool::IsCompatibleWithSession(CAmount nDenom, CTransaction txColla LogPrintf("CDarksendPool::IsCompatibleWithSession - sessionDenom %d sessionUsers %d\n", sessionDenom, sessionUsers); if (!unitTest && !IsCollateralValid(txCollateral)){ - LogPrint("darksend", "CDarksendPool::IsCompatibleWithSession - collateral not valid!\n"); + LogPrint("privatesend", "CDarksendPool::IsCompatibleWithSession - collateral not valid!\n"); errorID = ERR_INVALID_COLLATERAL; return false; } @@ -2224,7 +2224,7 @@ void CDarksendPool::RelayCompletedTransaction(const int sessionID, const bool er void CDarksendPool::UpdatedBlockTip(const CBlockIndex *pindex) { pCurrentBlockIndex = pindex; - LogPrint("darksend", "pCurrentBlockIndex->nHeight: %d\n", pCurrentBlockIndex->nHeight); + LogPrint("privatesend", "pCurrentBlockIndex->nHeight: %d\n", pCurrentBlockIndex->nHeight); if(!fLiteMode && masternodeSync.RequestedMasternodeAssets > MASTERNODE_SYNC_LIST) NewBlock(); diff --git a/src/darksend.h b/src/darksend.h index d448d6c694..e2ce3bbbdf 100644 --- a/src/darksend.h +++ b/src/darksend.h @@ -443,7 +443,7 @@ public: void UpdateState(unsigned int newState) { if (fMasterNode && (newState == POOL_STATUS_ERROR || newState == POOL_STATUS_SUCCESS)){ - LogPrint("darksend", "CDarksendPool::UpdateState() - Can't set state to ERROR or SUCCESS as a Masternode. \n"); + LogPrint("privatesend", "CDarksendPool::UpdateState() - Can't set state to ERROR or SUCCESS as a Masternode. \n"); return; } diff --git a/src/init.cpp b/src/init.cpp index cde3212aa7..86dac58cc4 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -515,7 +515,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-limitdescendantsize=", strprintf("Do not accept transactions if any ancestor would have more than kilobytes of in-mempool descendants (default: %u).", DEFAULT_DESCENDANT_SIZE_LIMIT)); } string debugCategories = "addrman, alert, bench, coindb, db, lock, rand, rpc, selectcoins, mempool, mempoolrej, net, proxy, prune, http, libevent, tor, zmq, " - "dash (or specifically: darksend, instantx, masternode, keepass, mnpayments, mngovernance)"; // Don't translate these and qt below + "dash (or specifically: privatesend, instantsend, masternode, keepass, mnpayments, mngovernance)"; // Don't translate these and qt below if (mode == HMM_BITCOIN_QT) debugCategories += ", qt"; strUsage += HelpMessageOpt("-debug=", strprintf(_("Output debugging information (default: %u, supplying is optional)"), 0) + ". " + @@ -560,16 +560,16 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-budgetvotemode=", _("Change automatic finalized budget voting behavior. mode=auto: Vote for only exact finalized budget match to my generated budget. (string, default: auto)")); strUsage += HelpMessageGroup(_("PrivateSend options:")); - strUsage += HelpMessageOpt("-enabledarksend=", strprintf(_("Enable use of automated PrivateSend for funds stored in this wallet (0-1, default: %u)"), fEnableDarksend)); - strUsage += HelpMessageOpt("-darksendmultisession=", strprintf(_("Enable multiple PrivateSend mixing sessions per block, experimental (0-1, default: %u)"), fDarksendMultiSession)); - strUsage += HelpMessageOpt("-darksendrounds=", strprintf(_("Use N separate masternodes to anonymize funds (2-8, default: %u)"), nDarksendRounds)); + strUsage += HelpMessageOpt("-enableprivatesend=", strprintf(_("Enable use of automated PrivateSend for funds stored in this wallet (0-1, default: %u)"), fEnablePrivateSend)); + strUsage += HelpMessageOpt("-privatesendmultisession=", strprintf(_("Enable multiple PrivateSend mixing sessions per block, experimental (0-1, default: %u)"), fPrivateSendMultiSession)); + strUsage += HelpMessageOpt("-privatesendrounds=", strprintf(_("Use N separate masternodes to anonymize funds (2-8, default: %u)"), nPrivateSendRounds)); strUsage += HelpMessageOpt("-anonymizedashamount=", strprintf(_("Keep N DASH anonymized (default: %u)"), nAnonymizeDashAmount)); strUsage += HelpMessageOpt("-liquidityprovider=", strprintf(_("Provide liquidity to PrivateSend by infrequently mixing coins on a continual basis (0-100, default: %u, 1=very frequent, high fees, 100=very infrequent, low fees)"), nLiquidityProvider)); strUsage += HelpMessageGroup(_("InstantSend options:")); - strUsage += HelpMessageOpt("-enableinstantx=", strprintf(_("Enable InstantSend, show confirmations for locked transactions (0-1, default: %u)"), fEnableInstantX)); - strUsage += HelpMessageOpt("-instantxdepth=", strprintf(_("Show N confirmations for a successfully locked transaction (0-9999, default: %u)"), nInstantXDepth)); - strUsage += HelpMessageOpt("-ixnotify=", _("Execute command when a wallet IX transaction is successfully locked (%s in cmd is replaced by TxID)")); + strUsage += HelpMessageOpt("-enableinstantsend=", strprintf(_("Enable InstantSend, show confirmations for locked transactions (0-1, default: %u)"), fEnableInstantSend)); + strUsage += HelpMessageOpt("-instantsenddepth=", strprintf(_("Show N confirmations for a successfully locked transaction (0-9999, default: %u)"), nInstantSendDepth)); + strUsage += HelpMessageOpt("-instantsendnotify=", _("Execute command when a wallet IS transaction is successfully locked (%s in cmd is replaced by TxID)")); strUsage += HelpMessageGroup(_("Node relay options:")); @@ -859,21 +859,21 @@ void InitParameterInteraction() LogPrintf("%s: parameter interaction: -whitelistforcerelay=1 -> setting -whitelistrelay=1\n", __func__); } - if(!GetBoolArg("-enableinstantx", fEnableInstantX)){ - if (SoftSetArg("-instantxdepth", 0)) - LogPrintf("AppInit2 : parameter interaction: -enableinstantx=false -> setting -nInstantXDepth=0\n"); + if(!GetBoolArg("-enableinstantsend", fEnableInstantSend)){ + if (SoftSetArg("-instantsenddepth", 0)) + LogPrintf("AppInit2 : parameter interaction: -enableinstantsend=false -> setting -nInstantSendDepth=0\n"); } if (GetArg("-liquidityprovider", 0) > 0) { int nLiqProvTmp = GetArg("-liquidityprovider", 0); - mapArgs["-enabledarksend"] = "1"; - LogPrintf("AppInit2 : parameter interaction: -liquidityprovider=%d -> setting -enabledarksend=1\n", nLiqProvTmp); - mapArgs["-darksendrounds"] = "99999"; - LogPrintf("AppInit2 : parameter interaction: -liquidityprovider=%d -> setting -darksendrounds=99999\n", nLiqProvTmp); + mapArgs["-enableprivatesend"] = "1"; + LogPrintf("AppInit2 : parameter interaction: -liquidityprovider=%d -> setting -enableprivatesend=1\n", nLiqProvTmp); + mapArgs["-privatesendrounds"] = "99999"; + LogPrintf("AppInit2 : parameter interaction: -liquidityprovider=%d -> setting -privatesendrounds=99999\n", nLiqProvTmp); mapArgs["-anonymizedashamount"] = "999999"; LogPrintf("AppInit2 : parameter interaction: -liquidityprovider=%d -> setting -anonymizedashamount=999999\n", nLiqProvTmp); - mapArgs["-darksendmultisession"] = "0"; - LogPrintf("AppInit2 : parameter interaction: -liquidityprovider=%d -> setting -darksendmultisession=0\n", nLiqProvTmp); + mapArgs["-privatesendmultisession"] = "0"; + LogPrintf("AppInit2 : parameter interaction: -liquidityprovider=%d -> setting -privatesendmultisession=0\n", nLiqProvTmp); } } @@ -1897,16 +1897,16 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) nLiquidityProvider = std::min(std::max(nLiquidityProvider, 0), 100); darkSendPool.SetMinBlockSpacing(nLiquidityProvider * 15); - fEnableDarksend = GetBoolArg("-enabledarksend", fEnableDarksend); - fDarksendMultiSession = GetBoolArg("-darksendmultisession", fDarksendMultiSession); - nDarksendRounds = GetArg("-darksendrounds", nDarksendRounds); - nDarksendRounds = std::min(std::max(nDarksendRounds, 1), 99999); + fEnablePrivateSend = GetBoolArg("-enableprivatesend", fEnablePrivateSend); + fPrivateSendMultiSession = GetBoolArg("-privatesendmultisession", fPrivateSendMultiSession); + nPrivateSendRounds = GetArg("-privatesendrounds", nPrivateSendRounds); + nPrivateSendRounds = std::min(std::max(nPrivateSendRounds, 1), 99999); nAnonymizeDashAmount = GetArg("-anonymizedashamount", nAnonymizeDashAmount); nAnonymizeDashAmount = std::min(std::max(nAnonymizeDashAmount, 2), 999999); - fEnableInstantX = GetBoolArg("-enableinstantx", fEnableInstantX); - nInstantXDepth = GetArg("-instantxdepth", nInstantXDepth); - nInstantXDepth = std::min(std::max(nInstantXDepth, 0), 60); + fEnableInstantSend = GetBoolArg("-enableinstantsend", fEnableInstantSend); + nInstantSendDepth = GetArg("-instantsenddepth", nInstantSendDepth); + nInstantSendDepth = std::min(std::max(nInstantSendDepth, 0), 60); //lite mode disables all Masternode and Darksend related functionality fLiteMode = GetBoolArg("-litemode", false); @@ -1915,8 +1915,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) } LogPrintf("fLiteMode %d\n", fLiteMode); - LogPrintf("nInstantXDepth %d\n", nInstantXDepth); - LogPrintf("PrivateSend rounds %d\n", nDarksendRounds); + LogPrintf("nInstantSendDepth %d\n", nInstantSendDepth); + LogPrintf("PrivateSend rounds %d\n", nPrivateSendRounds); LogPrintf("Anonymize Dash Amount %d\n", nAnonymizeDashAmount); LogPrintf("Budget Mode %s\n", strBudgetMode); diff --git a/src/instantx.cpp b/src/instantx.cpp index a8ba4912c6..8fa870b1dc 100644 --- a/src/instantx.cpp +++ b/src/instantx.cpp @@ -169,7 +169,7 @@ bool IsIXTXValid(const CTransaction& txCollateral){ if(txCollateral.vout.size() < 1) return false; if(!CheckFinalTx(txCollateral)) { - LogPrint("instantx", "IsIXTXValid - Transaction is not final - %s\n", txCollateral.ToString()); + LogPrint("instantsend", "IsIXTXValid - Transaction is not final - %s\n", txCollateral.ToString()); return false; } @@ -193,12 +193,12 @@ bool IsIXTXValid(const CTransaction& txCollateral){ } if(nValueOut > GetSporkValue(SPORK_5_MAX_VALUE)*COIN){ - LogPrint("instantx", "IsIXTXValid - Transaction value too high - %s\n", txCollateral.ToString()); + LogPrint("instantsend", "IsIXTXValid - Transaction value too high - %s\n", txCollateral.ToString()); return false; } if(missingTx){ - LogPrint("instantx", "IsIXTXValid - Unknown inputs in IX transaction - %s\n", txCollateral.ToString()); + LogPrint("instantsend", "IsIXTXValid - Unknown inputs in IX transaction - %s\n", txCollateral.ToString()); /* This happens sometimes for an unknown reason, so we'll return that it's a valid transaction. If someone submits an invalid transaction it will be rejected by the network anyway and this isn't @@ -208,7 +208,7 @@ bool IsIXTXValid(const CTransaction& txCollateral){ } if(nValueIn-nValueOut < CENT) { - LogPrint("instantx", "IsIXTXValid - did not include enough fees in transaction %d\n%s\n", nValueOut-nValueIn, txCollateral.ToString()); + LogPrint("instantsend", "IsIXTXValid - did not include enough fees in transaction %d\n%s\n", nValueOut-nValueIn, txCollateral.ToString()); return false; } @@ -252,7 +252,7 @@ int64_t CreateNewLock(CTransaction tx) mapTxLocks.insert(make_pair(tx.GetHash(), newLock)); } else { mapTxLocks[tx.GetHash()].nBlockHeight = nBlockHeight; - LogPrint("instantx", "CreateNewLock - Transaction Lock Exists %s !\n", tx.GetHash().ToString()); + LogPrint("instantsend", "CreateNewLock - Transaction Lock Exists %s !\n", tx.GetHash().ToString()); } @@ -269,20 +269,20 @@ void DoConsensusVote(CTransaction& tx, int64_t nBlockHeight) if(n == -1) { - LogPrint("instantx", "InstantX::DoConsensusVote - Unknown Masternode %s\n", activeMasternode.vin.ToString()); + LogPrint("instantsend", "InstantX::DoConsensusVote - Unknown Masternode %s\n", activeMasternode.vin.ToString()); return; } if(n > INSTANTX_SIGNATURES_TOTAL) { - LogPrint("instantx", "InstantX::DoConsensusVote - Masternode not in the top %d (%d)\n", INSTANTX_SIGNATURES_TOTAL, n); + LogPrint("instantsend", "InstantX::DoConsensusVote - Masternode not in the top %d (%d)\n", INSTANTX_SIGNATURES_TOTAL, n); return; } /* nBlockHeight calculated from the transaction is the authoritive source */ - LogPrint("instantx", "InstantX::DoConsensusVote - In the top %d (%d)\n", INSTANTX_SIGNATURES_TOTAL, n); + LogPrint("instantsend", "InstantX::DoConsensusVote - In the top %d (%d)\n", INSTANTX_SIGNATURES_TOTAL, n); CConsensusVote ctx; ctx.vinMasternode = activeMasternode.vin; @@ -310,19 +310,19 @@ bool ProcessConsensusVote(CNode* pnode, CConsensusVote& ctx) CMasternode* pmn = mnodeman.Find(ctx.vinMasternode); if(pmn != NULL) - LogPrint("instantx", "InstantX::ProcessConsensusVote - Masternode ADDR %s %d\n", pmn->addr.ToString(), n); + LogPrint("instantsend", "InstantX::ProcessConsensusVote - Masternode ADDR %s %d\n", pmn->addr.ToString(), n); if(n == -1) { //can be caused by past versions trying to vote with an invalid protocol - LogPrint("instantx", "InstantX::ProcessConsensusVote - Unknown Masternode %s\n", ctx.vinMasternode.ToString()); + LogPrint("instantsend", "InstantX::ProcessConsensusVote - Unknown Masternode %s\n", ctx.vinMasternode.ToString()); mnodeman.AskForMN(pnode, ctx.vinMasternode); return false; } if(n > INSTANTX_SIGNATURES_TOTAL) { - LogPrint("instantx", "InstantX::ProcessConsensusVote - Masternode not in the top %d (%d) - %s\n", INSTANTX_SIGNATURES_TOTAL, n, ctx.GetHash().ToString()); + LogPrint("instantsend", "InstantX::ProcessConsensusVote - Masternode not in the top %d (%d) - %s\n", INSTANTX_SIGNATURES_TOTAL, n, ctx.GetHash().ToString()); return false; } @@ -343,7 +343,7 @@ bool ProcessConsensusVote(CNode* pnode, CConsensusVote& ctx) newLock.txHash = ctx.txHash; mapTxLocks.insert(make_pair(ctx.txHash, newLock)); } else - LogPrint("instantx", "InstantX::ProcessConsensusVote - Transaction Lock Exists %s !\n", ctx.txHash.ToString()); + LogPrint("instantsend", "InstantX::ProcessConsensusVote - Transaction Lock Exists %s !\n", ctx.txHash.ToString()); //compile consessus vote std::map::iterator i = mapTxLocks.find(ctx.txHash); @@ -351,10 +351,10 @@ bool ProcessConsensusVote(CNode* pnode, CConsensusVote& ctx) (*i).second.AddSignature(ctx); int nSignatures = (*i).second.CountSignatures(); - LogPrint("instantx", "InstantX::ProcessConsensusVote - Transaction Lock Votes %d - %s !\n", nSignatures, ctx.GetHash().ToString()); + LogPrint("instantsend", "InstantX::ProcessConsensusVote - Transaction Lock Votes %d - %s !\n", nSignatures, ctx.GetHash().ToString()); if(nSignatures >= INSTANTX_SIGNATURES_REQUIRED){ - LogPrint("instantx", "InstantX::ProcessConsensusVote - Transaction Lock Is Complete %s !\n", ctx.txHash.ToString()); + LogPrint("instantsend", "InstantX::ProcessConsensusVote - Transaction Lock Is Complete %s !\n", ctx.txHash.ToString()); // Masternodes will sometimes propagate votes before the transaction is known to the client, // will check for conflicting locks and update transaction status on a new vote message @@ -368,7 +368,7 @@ bool ProcessConsensusVote(CNode* pnode, CConsensusVote& ctx) } else if(mapTxLockReqRejected.count(ctx.txHash)) { ResolveConflicts(mapTxLockReqRejected[ctx.txHash]); ///????? } else { - LogPrint("instantx", "InstantX::ProcessConsensusVote - Transaction Lock Request is missing %s ! votes %d\n", ctx.GetHash().ToString(), nSignatures); + LogPrint("instantsend", "InstantX::ProcessConsensusVote - Transaction Lock Request is missing %s ! votes %d\n", ctx.GetHash().ToString(), nSignatures); } } } @@ -394,7 +394,7 @@ void UpdateLockedTransaction(CTransaction& tx, bool fForceNotification) { // a transaction lock must have enough signatures to trigger this notification if(nSignatures == INSTANTX_SIGNATURES_REQUIRED || (fForceNotification && nSignatures > INSTANTX_SIGNATURES_REQUIRED)) { // notify an external script once threshold is reached - std::string strCmd = GetArg("-ixnotify", ""); + std::string strCmd = GetArg("-instantsendnotify", ""); if ( !strCmd.empty()) { boost::replace_all(strCmd, "%s", txHash.GetHex()); @@ -504,7 +504,7 @@ int GetTransactionLockSignatures(uint256 txHash) { if(fLargeWorkForkFound || fLargeWorkInvalidChainFound) return -2; if(!IsSporkActive(SPORK_2_INSTANTX)) return -3; - if(!fEnableInstantX) return -1; + if(!fEnableInstantSend) return -1; std::map::iterator i = mapTxLocks.find(txHash); if (i != mapTxLocks.end()){ @@ -516,7 +516,7 @@ int GetTransactionLockSignatures(uint256 txHash) bool IsTransactionLockTimedOut(uint256 txHash) { - if(!fEnableInstantX) return 0; + if(!fEnableInstantSend) return 0; std::map::iterator i = mapTxLocks.find(txHash); if (i != mapTxLocks.end()){ diff --git a/src/main.cpp b/src/main.cpp index 461909d4ad..59b06b4d16 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -774,7 +774,7 @@ int GetInputAgeIX(uint256 nTXHash, CTxIn& vin) if(nResult < 0) return -1; if (nResult < 6 && IsLockedIXTransaction(nTXHash)) - return nInstantXDepth + nResult; + return nInstantSendDepth + nResult; return nResult; } @@ -782,7 +782,7 @@ int GetInputAgeIX(uint256 nTXHash, CTxIn& vin) int GetIXConfirmations(uint256 nTXHash) { if (IsLockedIXTransaction(nTXHash)) - return nInstantXDepth; + return nInstantSendDepth; return 0; } diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index 6273303961..c9163851eb 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -448,8 +448,8 @@ void CoinControlDialog::viewItemChanged(QTreeWidgetItem* item, int column) else { coinControl->Select(outpt); CTxIn vin(outpt); - int rounds = pwalletMain->GetInputDarksendRounds(vin); - if(coinControl->useDarkSend && rounds < nDarksendRounds) { + int rounds = pwalletMain->GetInputPrivateSendRounds(vin); + if(coinControl->useDarkSend && rounds < nPrivateSendRounds) { QMessageBox::warning(this, windowTitle(), tr("Non-anonymized input selected. PrivateSend will be disabled.

If you still want to use PrivateSend, please deselect all non-nonymized inputs first and then check PrivateSend checkbox again."), QMessageBox::Ok, QMessageBox::Ok); @@ -843,7 +843,7 @@ void CoinControlDialog::updateView() // ds+ rounds CTxIn vin = CTxIn(out.tx->GetHash(), out.i); - int rounds = pwalletMain->GetInputDarksendRounds(vin); + int rounds = pwalletMain->GetInputPrivateSendRounds(vin); if(rounds >= 0 || fDebug) itemOutput->setText(COLUMN_DARKSEND_ROUNDS, strPad(QString::number(rounds), 11, " ")); else itemOutput->setText(COLUMN_DARKSEND_ROUNDS, strPad(QString(tr("n/a")), 11, " ")); diff --git a/src/qt/darksendconfig.cpp b/src/qt/darksendconfig.cpp index 0276632430..5d06751ba3 100644 --- a/src/qt/darksendconfig.cpp +++ b/src/qt/darksendconfig.cpp @@ -83,9 +83,9 @@ void DarksendConfig::configure(bool enabled, int coins, int rounds) { QSettings settings; - settings.setValue("nDarksendRounds", rounds); + settings.setValue("nPrivateSendRounds", rounds); settings.setValue("nAnonymizeDashAmount", coins); - nDarksendRounds = rounds; + nPrivateSendRounds = rounds; nAnonymizeDashAmount = coins; } diff --git a/src/qt/dashstrings.cpp b/src/qt/dashstrings.cpp index b6f7f97ab1..8423f811b0 100644 --- a/src/qt/dashstrings.cpp +++ b/src/qt/dashstrings.cpp @@ -57,7 +57,7 @@ QT_TRANSLATE_NOOP("dash-core", "" "Enable InstantSend, show confirmations for locked transactions (bool, default: " "%s)"), QT_TRANSLATE_NOOP("dash-core", "" -"Enable use of automated darksend for funds stored in this wallet (0-1, " +"Enable use of automated privatesend for funds stored in this wallet (0-1, " "default: %u)"), QT_TRANSLATE_NOOP("dash-core", "" "Enter regression test mode, which uses a special chain in which blocks can " diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui index eb2a7e45bf..08967df766 100644 --- a/src/qt/forms/optionsdialog.ui +++ b/src/qt/forms/optionsdialog.ui @@ -189,7 +189,7 @@ - + 2 diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 3a37aec33d..b2dc456d38 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -198,7 +198,7 @@ void OptionsDialog::setMapper() mapper->addMapping(ui->spendZeroConfChange, OptionsModel::SpendZeroConfChange); mapper->addMapping(ui->showMasternodesTab, OptionsModel::ShowMasternodesTab); mapper->addMapping(ui->coinControlFeatures, OptionsModel::CoinControlFeatures); - mapper->addMapping(ui->darksendRounds, OptionsModel::DarksendRounds); + mapper->addMapping(ui->privateSendRounds, OptionsModel::PrivateSendRounds); mapper->addMapping(ui->anonymizeDash, OptionsModel::AnonymizeDashAmount); /* Network */ diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index 994785976e..c14f13378a 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -111,11 +111,11 @@ void OptionsModel::Init(bool resetSettings) addOverriddenOption("-spendzeroconfchange"); // Darksend - if (!settings.contains("nDarksendRounds")) - settings.setValue("nDarksendRounds", 2); - if (!SoftSetArg("-darksendrounds", settings.value("nDarksendRounds").toString().toStdString())) - addOverriddenOption("-darksendrounds"); - nDarksendRounds = settings.value("nDarksendRounds").toInt(); + if (!settings.contains("nPrivateSendRounds")) + settings.setValue("nPrivateSendRounds", 2); + if (!SoftSetArg("-privatesendrounds", settings.value("nPrivateSendRounds").toString().toStdString())) + addOverriddenOption("-privatesendrounds"); + nPrivateSendRounds = settings.value("nPrivateSendRounds").toInt(); if (!settings.contains("nAnonymizeDashAmount")) { // for migration from old settings @@ -239,8 +239,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const #ifdef ENABLE_WALLET case SpendZeroConfChange: return settings.value("bSpendZeroConfChange"); - case DarksendRounds: - return settings.value("nDarksendRounds"); + case PrivateSendRounds: + return settings.value("nPrivateSendRounds"); case AnonymizeDashAmount: return settings.value("nAnonymizeDashAmount"); case ShowMasternodesTab: @@ -367,11 +367,11 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in setRestartRequired(true); } break; - case DarksendRounds: - if (settings.value("nDarksendRounds") != value) + case PrivateSendRounds: + if (settings.value("nPrivateSendRounds") != value) { - nDarksendRounds = value.toInt(); - settings.setValue("nDarksendRounds", nDarksendRounds); + nPrivateSendRounds = value.toInt(); + settings.setValue("nPrivateSendRounds", nPrivateSendRounds); Q_EMIT darksendRoundsChanged(); } break; diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index 91cf517da6..3ff62b838d 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -46,7 +46,7 @@ public: ThreadsScriptVerif, // int DatabaseCache, // int SpendZeroConfChange, // bool - DarksendRounds, // int + PrivateSendRounds, // int AnonymizeDashAmount, // int ShowMasternodesTab, // bool Listen, // bool diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 49d08c4849..039f6b1cf9 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -157,7 +157,7 @@ OverviewPage::OverviewPage(const PlatformStyle *platformStyle, QWidget *parent) ui->darksendReset->setText("(" + tr("Disabled") + ")"); ui->frameDarksend->setEnabled(false); } else { - if(!fEnableDarksend){ + if(!fEnablePrivateSend){ ui->toggleDarksend->setText(tr("Start Mixing")); } else { ui->toggleDarksend->setText(tr("Stop Mixing")); @@ -337,7 +337,7 @@ void OverviewPage::updateDarksendProgress() // when balance is zero just show info from settings strAnonymizeDashAmount = strAnonymizeDashAmount.remove(strAnonymizeDashAmount.indexOf("."), BitcoinUnits::decimals(nDisplayUnit) + 1); - strAmountAndRounds = strAnonymizeDashAmount + " / " + tr("%n Rounds", "", nDarksendRounds); + strAmountAndRounds = strAnonymizeDashAmount + " / " + tr("%n Rounds", "", nPrivateSendRounds); ui->labelAmountRounds->setToolTip(tr("No inputs detected")); ui->labelAmountRounds->setText(strAmountAndRounds); @@ -369,7 +369,7 @@ void OverviewPage::updateDarksendProgress() ui->labelAmountRounds->setToolTip(tr("Found enough compatible inputs to anonymize %1") .arg(strAnonymizeDashAmount)); strAnonymizeDashAmount = strAnonymizeDashAmount.remove(strAnonymizeDashAmount.indexOf("."), BitcoinUnits::decimals(nDisplayUnit) + 1); - strAmountAndRounds = strAnonymizeDashAmount + " / " + tr("%n Rounds", "", nDarksendRounds); + strAmountAndRounds = strAnonymizeDashAmount + " / " + tr("%n Rounds", "", nPrivateSendRounds); } else { QString strMaxToAnonymize = BitcoinUnits::formatHtmlWithUnit(nDisplayUnit, nMaxToAnonymize, false, BitcoinUnits::separatorAlways); ui->labelAmountRounds->setToolTip(tr("Not enough compatible inputs to anonymize %1,
" @@ -379,7 +379,7 @@ void OverviewPage::updateDarksendProgress() strMaxToAnonymize = strMaxToAnonymize.remove(strMaxToAnonymize.indexOf("."), BitcoinUnits::decimals(nDisplayUnit) + 1); strAmountAndRounds = "" + QString(BitcoinUnits::factor(nDisplayUnit) == 1 ? "" : "~") + strMaxToAnonymize + - " / " + tr("%n Rounds", "", nDarksendRounds) + ""; + " / " + tr("%n Rounds", "", nPrivateSendRounds) + ""; } ui->labelAmountRounds->setText(strAmountAndRounds); @@ -406,7 +406,7 @@ void OverviewPage::updateDarksendProgress() // apply some weights to them ... float denomWeight = 1; - float anonNormWeight = nDarksendRounds; + float anonNormWeight = nPrivateSendRounds; float anonFullWeight = 2; float fullWeight = denomWeight + anonNormWeight + anonFullWeight; // ... and calculate the whole progress @@ -422,7 +422,7 @@ void OverviewPage::updateDarksendProgress() tr("Denominated") + ": %2%
" + tr("Mixed") + ": %3%
" + tr("Anonymized") + ": %4%
" + - tr("Denominated inputs have %5 of %n rounds on average", "", nDarksendRounds)) + tr("Denominated inputs have %5 of %n rounds on average", "", nPrivateSendRounds)) .arg(progress).arg(denomPart).arg(anonNormPart).arg(anonFullPart) .arg(nAverageAnonymizedRounds); ui->darksendProgress->setToolTip(strToolPip); @@ -440,7 +440,7 @@ void OverviewPage::darkSendStatus() if(((nBestHeight - darkSendPool.cachedNumBlocks) / (GetTimeMillis() - nLastDSProgressBlockTime + 1) > 1)) return; nLastDSProgressBlockTime = GetTimeMillis(); - if(!fEnableDarksend) { + if(!fEnablePrivateSend) { if(nBestHeight != darkSendPool.cachedNumBlocks) { darkSendPool.cachedNumBlocks = nBestHeight; @@ -506,7 +506,7 @@ void OverviewPage::toggleDarksend(){ QMessageBox::Ok, QMessageBox::Ok); settings.setValue("hasMixed", "hasMixed"); } - if(!fEnableDarksend){ + if(!fEnablePrivateSend){ int64_t balance = currentBalance; float minAmount = 1.49 * COIN; if(balance < minAmount){ @@ -535,10 +535,10 @@ void OverviewPage::toggleDarksend(){ } - fEnableDarksend = !fEnableDarksend; + fEnablePrivateSend = !fEnablePrivateSend; darkSendPool.cachedNumBlocks = std::numeric_limits::max(); - if(!fEnableDarksend){ + if(!fEnablePrivateSend){ ui->toggleDarksend->setText(tr("Start Mixing")); darkSendPool.UnlockCoins(); } else { diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index eb97f753aa..50e229bb3f 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -262,7 +262,7 @@ void SendCoinsDialog::on_sendButton_clicked() BitcoinUnits::formatWithUnit( model->getOptionsModel()->getDisplayUnit(), 0.1 * COIN)); strFee = QString(tr( - "(darksend requires this amount to be rounded up to the nearest %1)." + "(privatesend requires this amount to be rounded up to the nearest %1)." ).arg(strNearestAmount)); } else { recipients[0].inputType = ALL_COINS; diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index bc59aca629..b3fc265659 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -130,13 +130,13 @@ void WalletModel::pollBalanceChanged() if(!lockWallet) return; - if(fForceCheckBalanceChanged || chainActive.Height() != cachedNumBlocks || nDarksendRounds != cachedDarksendRounds || cachedTxLocks != nCompleteTXLocks) + if(fForceCheckBalanceChanged || chainActive.Height() != cachedNumBlocks || nPrivateSendRounds != cachedPrivateSendRounds || cachedTxLocks != nCompleteTXLocks) { fForceCheckBalanceChanged = false; // Balance and number of transactions might have changed cachedNumBlocks = chainActive.Height(); - cachedDarksendRounds = nDarksendRounds; + cachedPrivateSendRounds = nPrivateSendRounds; checkBalanceChanged(); if(transactionTableModel) diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h index beca11c4db..0bca129a36 100644 --- a/src/qt/walletmodel.h +++ b/src/qt/walletmodel.h @@ -233,7 +233,7 @@ private: EncryptionStatus cachedEncryptionStatus; int cachedNumBlocks; int cachedTxLocks; - int cachedDarksendRounds; + int cachedPrivateSendRounds; QTimer *pollTimer; diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index 04291f05ba..fbaac4bd1d 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -37,7 +37,7 @@ static const CRPCConvertParam vRPCConvertParams[] = { "sendtoaddress", 4 }, { "sendtoaddress", 5 }, { "sendtoaddress", 6 }, - { "sendtoaddressix", 1 }, + { "instantsendtoaddress", 1 }, { "settxfee", 0 }, { "getreceivedbyaddress", 1 }, { "getreceivedbyaccount", 1 }, diff --git a/src/rpcmasternode.cpp b/src/rpcmasternode.cpp index 12377c0430..4b13c608c9 100644 --- a/src/rpcmasternode.cpp +++ b/src/rpcmasternode.cpp @@ -19,11 +19,11 @@ #include #include -UniValue darksend(const UniValue& params, bool fHelp) +UniValue privatesend(const UniValue& params, bool fHelp) { if (fHelp || params.size() != 1) throw runtime_error( - "darksend \"command\"\n" + "privatesend \"command\"\n" "\nArguments:\n" "1. \"command\" (string or set of strings, required) The command to execute\n" "\nAvailable commands:\n" @@ -40,14 +40,14 @@ UniValue darksend(const UniValue& params, bool fHelp) if(fMasterNode) return "Mixing is not supported from masternodes"; - fEnableDarksend = true; + fEnablePrivateSend = true; bool result = darkSendPool.DoAutomaticDenominating(); -// fEnableDarksend = result; +// fEnablePrivateSend = result; return "Mixing " + (result ? "started successfully" : ("start failed: " + darkSendPool.GetStatus() + ", will retry")); } if(params[0].get_str() == "stop"){ - fEnableDarksend = false; + fEnablePrivateSend = false; return "Mixing was stopped"; } @@ -60,7 +60,7 @@ UniValue darksend(const UniValue& params, bool fHelp) return "Mixing status: " + darkSendPool.GetStatus(); } - return "Unknown command, please see \"help darksend\""; + return "Unknown command, please see \"help privatesend\""; } UniValue getpoolinfo(const UniValue& params, bool fHelp) diff --git a/src/rpcserver.cpp b/src/rpcserver.cpp index 856a6690c6..5e5747ba99 100644 --- a/src/rpcserver.cpp +++ b/src/rpcserver.cpp @@ -344,11 +344,11 @@ static const CRPCCommand vRPCCommands[] = { "dash", "spork", &spork, true }, { "dash", "getpoolinfo", &getpoolinfo, true }, #ifdef ENABLE_WALLET - { "dash", "darksend", &darksend, false }, + { "dash", "privatesend", &privatesend, false }, /* Wallet */ { "wallet", "keepass", &keepass, true }, - { "wallet", "sendtoaddressix", &sendtoaddressix, false }, + { "wallet", "instantsendtoaddress", &instantsendtoaddress, false }, { "wallet", "addmultisigaddress", &addmultisigaddress, true }, { "wallet", "backupwallet", &backupwallet, true }, { "wallet", "dumpprivkey", &dumpprivkey, true }, diff --git a/src/rpcserver.h b/src/rpcserver.h index 6a0f7c3c1e..4f922b6d61 100644 --- a/src/rpcserver.h +++ b/src/rpcserver.h @@ -202,7 +202,7 @@ extern UniValue estimatepriority(const UniValue& params, bool fHelp); extern UniValue estimatesmartfee(const UniValue& params, bool fHelp); extern UniValue estimatesmartpriority(const UniValue& params, bool fHelp); -extern UniValue sendtoaddressix(const UniValue& params, bool fHelp); +extern UniValue instantsendtoaddress(const UniValue& params, bool fHelp); extern UniValue keepass(const UniValue& params, bool fHelp); extern UniValue getnewaddress(const UniValue& params, bool fHelp); // in rpcwallet.cpp extern UniValue getaccountaddress(const UniValue& params, bool fHelp); @@ -258,7 +258,7 @@ extern UniValue sendrawtransaction(const UniValue& params, bool fHelp); extern UniValue gettxoutproof(const UniValue& params, bool fHelp); extern UniValue verifytxoutproof(const UniValue& params, bool fHelp); -extern UniValue darksend(const UniValue& params, bool fHelp); +extern UniValue privatesend(const UniValue& params, bool fHelp); extern UniValue getpoolinfo(const UniValue& params, bool fHelp); extern UniValue spork(const UniValue& params, bool fHelp); extern UniValue masternode(const UniValue& params, bool fHelp); diff --git a/src/util.cpp b/src/util.cpp index f63a30beae..fa179ce3b3 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -107,16 +107,16 @@ bool fMasterNode = false; string strMasterNodePrivKey = ""; string strMasterNodeAddr = ""; bool fLiteMode = false; -bool fEnableInstantX = true; -int nInstantXDepth = 5; -int nDarksendRounds = 2; +bool fEnableInstantSend = true; +int nInstantSendDepth = 5; +int nPrivateSendRounds = 2; int nAnonymizeDashAmount = 1000; int nLiquidityProvider = 0; /** Spork enforcement enabled time */ int64_t enforceMasternodePaymentsTime = 4085657524; bool fSucessfullyLoaded = false; -bool fEnableDarksend = false; -bool fDarksendMultiSession = false; +bool fEnablePrivateSend = false; +bool fPrivateSendMultiSession = false; /** All denominations used by darksend */ std::vector darkSendDenominations; string strBudgetMode = ""; @@ -278,8 +278,8 @@ bool LogAcceptCategory(const char* category) // thread_specific_ptr automatically deletes the set when the thread ends. // "dash" is a composite category enabling all Dash-related debug output if(ptrCategory->count(string("dash"))) { - ptrCategory->insert(string("darksend")); - ptrCategory->insert(string("instantx")); + ptrCategory->insert(string("privatesend")); + ptrCategory->insert(string("instantsend")); ptrCategory->insert(string("masternode")); ptrCategory->insert(string("keepass")); ptrCategory->insert(string("mnpayments")); diff --git a/src/util.h b/src/util.h index 163d66eac3..3139ef947d 100644 --- a/src/util.h +++ b/src/util.h @@ -34,13 +34,13 @@ extern bool fMasterNode; extern bool fLiteMode; -extern bool fEnableInstantX; -extern int nInstantXDepth; -extern int nDarksendRounds; +extern bool fEnableInstantSend; +extern int nInstantSendDepth; +extern int nPrivateSendRounds; extern int nAnonymizeDashAmount; extern int nLiquidityProvider; -extern bool fEnableDarksend; -extern bool fDarksendMultiSession; +extern bool fEnablePrivateSend; +extern bool fPrivateSendMultiSession; extern int64_t enforceMasternodePaymentsTime; extern std::string strMasterNodeAddr; extern int keysLoaded; diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index e0d5f8c69a..daa8c22c79 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -410,7 +410,7 @@ UniValue sendtoaddress(const UniValue& params, bool fHelp) if (fHelp || params.size() < 2 || params.size() > 7) throw runtime_error( - "sendtoaddress \"dashaddress\" amount ( \"comment\" \"comment-to\" subtractfeefromamount use_ix use_ds )\n" + "sendtoaddress \"dashaddress\" amount ( \"comment\" \"comment-to\" subtractfeefromamount use_is use_ps )\n" "\nSend an amount to a given address.\n" + HelpRequiringPassphrase() + "\nArguments:\n" @@ -423,8 +423,8 @@ UniValue sendtoaddress(const UniValue& params, bool fHelp) " transaction, just kept in your wallet.\n" "5. subtractfeefromamount (boolean, optional, default=false) The fee will be deducted from the amount being sent.\n" " The recipient will receive less bitcoins than you enter in the amount field.\n" - "6. \"use_ix\" (bool, optional) Send this transaction as IX (default: false)\n" - "7. \"use_ds\" (bool, optional) Use anonymized funds only (default: false)\n" + "6. \"use_is\" (bool, optional) Send this transaction as InstantSend (default: false)\n" + "7. \"use_ps\" (bool, optional) Use anonymized funds only (default: false)\n" "\nResult:\n" "\"transactionid\" (string) The transaction id.\n" "\nExamples:\n" @@ -470,14 +470,14 @@ UniValue sendtoaddress(const UniValue& params, bool fHelp) return wtx.GetHash().GetHex(); } -UniValue sendtoaddressix(const UniValue& params, bool fHelp) +UniValue instantsendtoaddress(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; if (fHelp || params.size() < 2 || params.size() > 5) throw runtime_error( - "sendtoaddressix \"dashaddress\" amount ( \"comment\" \"comment-to\" subtractfeefromamount )\n" + "instantsendtoaddress \"dashaddress\" amount ( \"comment\" \"comment-to\" subtractfeefromamount )\n" "\nSend an amount to a given address. The amount is a real and is rounded to the nearest 0.00000001\n" + HelpRequiringPassphrase() + "\nArguments:\n" @@ -493,10 +493,10 @@ UniValue sendtoaddressix(const UniValue& params, bool fHelp) "\nResult:\n" "\"transactionid\" (string) The transaction id.\n" "\nExamples:\n" - + HelpExampleCli("sendtoaddressix", "\"XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg\" 0.1") - + HelpExampleCli("sendtoaddressix", "\"XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg\" 0.1 \"donation\" \"seans outpost\"") - + HelpExampleCli("sendtoaddressix", "\"XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg\" 0.1 \"\" \"\" true") - + HelpExampleRpc("sendtoaddressix", "\"XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg\", 0.1, \"donation\", \"seans outpost\"") + + HelpExampleCli("instantsendtoaddress", "\"XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg\" 0.1") + + HelpExampleCli("instantsendtoaddress", "\"XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg\" 0.1 \"donation\" \"seans outpost\"") + + HelpExampleCli("instantsendtoaddress", "\"XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg\" 0.1 \"\" \"\" true") + + HelpExampleRpc("instantsendtoaddress", "\"XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg\", 0.1, \"donation\", \"seans outpost\"") ); LOCK2(cs_main, pwalletMain->cs_wallet); @@ -1017,7 +1017,7 @@ UniValue sendmany(const UniValue& params, bool fHelp) if (fHelp || params.size() < 2 || params.size() > 7) throw runtime_error( - "sendmany \"fromaccount\" {\"address\":amount,...} ( minconf \"comment\" [\"address\",...] subtractfeefromamount use_ix use_ds )\n" + "sendmany \"fromaccount\" {\"address\":amount,...} ( minconf \"comment\" [\"address\",...] subtractfeefromamount use_is use_ps )\n" "\nSend multiple times. Amounts are double-precision floating point numbers." + HelpRequiringPassphrase() + "\n" "\nArguments:\n" @@ -1037,8 +1037,8 @@ UniValue sendmany(const UniValue& params, bool fHelp) " \"address\" (string) Subtract fee from this address\n" " ,...\n" " ]\n" - "6. \"use_ix\" (bool, optional) Send this transaction as IX (default: false)\n" - "7. \"use_ds\" (bool, optional) Use anonymized funds only (default: false)\n" + "6. \"use_is\" (bool, optional) Send this transaction as InstantSend (default: false)\n" + "7. \"use_ps\" (bool, optional) Use anonymized funds only (default: false)\n" "\nResult:\n" "\"transactionid\" (string) The transaction id for the send. Only 1 transaction is created regardless of \n" " the number of addresses.\n" diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 2a00112957..b69d952281 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -1030,7 +1030,7 @@ CAmount CWallet::GetDebit(const CTxIn &txin, const isminefilter& filter) const } // Recursively determine the rounds of a given input (How deep is the Darksend chain for a given input) -int CWallet::GetRealInputDarksendRounds(CTxIn in, int rounds) const +int CWallet::GetRealInputPrivateSendRounds(CTxIn in, int rounds) const { static std::map mDenomWtxes; @@ -1046,7 +1046,7 @@ int CWallet::GetRealInputDarksendRounds(CTxIn in, int rounds) const // not known yet, let's add it if(mdwi == mDenomWtxes.end()) { - LogPrint("darksend", "GetInputDarksendRounds INSERTING %s\n", hash.ToString()); + LogPrint("privatesend", "GetInputPrivateSendRounds INSERTING %s\n", hash.ToString()); mDenomWtxes[hash] = CMutableTransaction(*wtx); } // found and it's not an initial value, just return it @@ -1060,14 +1060,14 @@ int CWallet::GetRealInputDarksendRounds(CTxIn in, int rounds) const if(nout >= wtx->vout.size()) { // should never actually hit this - LogPrint("darksend", "GetInputDarksendRounds UPDATED %s %3d %3d\n", hash.ToString(), nout, -4); + LogPrint("privatesend", "GetInputPrivateSendRounds UPDATED %s %3d %3d\n", hash.ToString(), nout, -4); return -4; } if(pwalletMain->IsCollateralAmount(wtx->vout[nout].nValue)) { mDenomWtxes[hash].vout[nout].nRounds = -3; - LogPrint("darksend", "GetInputDarksendRounds UPDATED %s %3d %3d\n", hash.ToString(), nout, mDenomWtxes[hash].vout[nout].nRounds); + LogPrint("privatesend", "GetInputPrivateSendRounds UPDATED %s %3d %3d\n", hash.ToString(), nout, mDenomWtxes[hash].vout[nout].nRounds); return mDenomWtxes[hash].vout[nout].nRounds; } @@ -1075,7 +1075,7 @@ int CWallet::GetRealInputDarksendRounds(CTxIn in, int rounds) const if(/*rounds == 0 && */!IsDenominatedAmount(wtx->vout[nout].nValue)) //NOT DENOM { mDenomWtxes[hash].vout[nout].nRounds = -2; - LogPrint("darksend", "GetInputDarksendRounds UPDATED %s %3d %3d\n", hash.ToString(), nout, mDenomWtxes[hash].vout[nout].nRounds); + LogPrint("privatesend", "GetInputPrivateSendRounds UPDATED %s %3d %3d\n", hash.ToString(), nout, mDenomWtxes[hash].vout[nout].nRounds); return mDenomWtxes[hash].vout[nout].nRounds; } @@ -1088,7 +1088,7 @@ int CWallet::GetRealInputDarksendRounds(CTxIn in, int rounds) const if(!fAllDenoms) { mDenomWtxes[hash].vout[nout].nRounds = 0; - LogPrint("darksend", "GetInputDarksendRounds UPDATED %s %3d %3d\n", hash.ToString(), nout, mDenomWtxes[hash].vout[nout].nRounds); + LogPrint("privatesend", "GetInputPrivateSendRounds UPDATED %s %3d %3d\n", hash.ToString(), nout, mDenomWtxes[hash].vout[nout].nRounds); return mDenomWtxes[hash].vout[nout].nRounds; } @@ -1099,7 +1099,7 @@ int CWallet::GetRealInputDarksendRounds(CTxIn in, int rounds) const { if(IsMine(in2)) { - int n = GetRealInputDarksendRounds(in2, rounds+1); + int n = GetRealInputPrivateSendRounds(in2, rounds+1); // denom found, find the shortest chain or initially assign nShortest with the first found value if(n >= 0 && (n < nShortest || nShortest == -10)) { @@ -1111,7 +1111,7 @@ int CWallet::GetRealInputDarksendRounds(CTxIn in, int rounds) const mDenomWtxes[hash].vout[nout].nRounds = fDenomFound ? (nShortest >= 15 ? 16 : nShortest + 1) // good, we a +1 to the shortest one but only 16 rounds max allowed : 0; // too bad, we are the fist one in that chain - LogPrint("darksend", "GetInputDarksendRounds UPDATED %s %3d %3d\n", hash.ToString(), nout, mDenomWtxes[hash].vout[nout].nRounds); + LogPrint("privatesend", "GetInputPrivateSendRounds UPDATED %s %3d %3d\n", hash.ToString(), nout, mDenomWtxes[hash].vout[nout].nRounds); return mDenomWtxes[hash].vout[nout].nRounds; } @@ -1119,10 +1119,10 @@ int CWallet::GetRealInputDarksendRounds(CTxIn in, int rounds) const } // respect current settings -int CWallet::GetInputDarksendRounds(CTxIn in) const { +int CWallet::GetInputPrivateSendRounds(CTxIn in) const { LOCK(cs_wallet); - int realDarksendRounds = GetRealInputDarksendRounds(in, 0); - return realDarksendRounds > nDarksendRounds ? nDarksendRounds : realDarksendRounds; + int realPrivateSendRounds = GetRealInputPrivateSendRounds(in, 0); + return realPrivateSendRounds > nPrivateSendRounds ? nPrivateSendRounds : realPrivateSendRounds; } bool CWallet::IsDenominated(const CTxIn &txin) const @@ -1682,8 +1682,8 @@ CAmount CWalletTx::GetAnonymizableCredit(bool fUseCache) const // otherwise they will just lead to higher fee / lower priority if(vout[i].nValue <= darkSendDenominations[darkSendDenominations.size() - 1]/10) continue; - const int rounds = pwallet->GetInputDarksendRounds(vin); - if(rounds >=-2 && rounds < nDarksendRounds) { + const int rounds = pwallet->GetInputPrivateSendRounds(vin); + if(rounds >=-2 && rounds < nPrivateSendRounds) { nCredit += pwallet->GetCredit(txout, ISMINE_SPENDABLE); if (!MoneyRange(nCredit)) throw std::runtime_error("CWalletTx::GetAnonamizableCredit() : value out of range"); @@ -1716,8 +1716,8 @@ CAmount CWalletTx::GetAnonymizedCredit(bool fUseCache) const if(pwallet->IsSpent(hashTx, i) || !pwallet->IsDenominated(vin)) continue; - const int rounds = pwallet->GetInputDarksendRounds(vin); - if(rounds >= nDarksendRounds){ + const int rounds = pwallet->GetInputPrivateSendRounds(vin); + if(rounds >= nPrivateSendRounds){ nCredit += pwallet->GetCredit(txout, ISMINE_SPENDABLE); if (!MoneyRange(nCredit)) throw std::runtime_error("CWalletTx::GetAnonymizedCredit() : value out of range"); @@ -1967,7 +1967,7 @@ double CWallet::GetAverageAnonymizedRounds() const if(IsSpent(hash, i) || IsMine(pcoin->vout[i]) != ISMINE_SPENDABLE || !IsDenominated(vin)) continue; - int rounds = GetInputDarksendRounds(vin); + int rounds = GetInputPrivateSendRounds(vin); fTotal += (float)rounds; fCount += 1; } @@ -2002,8 +2002,8 @@ CAmount CWallet::GetNormalizedAnonymizedBalance() const if(IsSpent(hash, i) || IsMine(pcoin->vout[i]) != ISMINE_SPENDABLE || !IsDenominated(vin)) continue; if (pcoin->GetDepthInMainChain() < 0) continue; - int rounds = GetInputDarksendRounds(vin); - nTotal += pcoin->vout[i].nValue * rounds / nDarksendRounds; + int rounds = GetInputPrivateSendRounds(vin); + nTotal += pcoin->vout[i].nValue * rounds / nPrivateSendRounds; } } } @@ -2369,9 +2369,9 @@ bool CWallet::SelectCoins(const CAmount& nTargetValue, setGetHash(),out.i); - int rounds = GetInputDarksendRounds(vin); + int rounds = GetInputPrivateSendRounds(vin); // make sure it's actually anonymized - if(rounds < nDarksendRounds) continue; + if(rounds < nPrivateSendRounds) continue; } nValueRet += out.tx->vout[out.i].nValue; setCoinsRet.insert(make_pair(out.tx, out.i)); @@ -2390,9 +2390,9 @@ bool CWallet::SelectCoins(const CAmount& nTargetValue, setvout[out.i].nValue < nTargetValue + (0.1*COIN)+100 //round the amount up to .1DRK over ){ CTxIn vin = CTxIn(out.tx->GetHash(),out.i); - int rounds = GetInputDarksendRounds(vin); + int rounds = GetInputPrivateSendRounds(vin); // make sure it's actually anonymized - if(rounds < nDarksendRounds) continue; + if(rounds < nPrivateSendRounds) continue; nValueRet += out.tx->vout[out.i].nValue; setCoinsRet.insert(make_pair(out.tx, out.i)); } @@ -2498,7 +2498,7 @@ bool CWallet::FundTransaction(CMutableTransaction& tx, CAmount &nFeeRet, int& nC return true; } -bool CWallet::SelectCoinsByDenominations(int nDenom, CAmount nValueMin, CAmount nValueMax, std::vector& vCoinsRet, std::vector& vCoinsRet2, CAmount& nValueRet, int nDarksendRoundsMin, int nDarksendRoundsMax) +bool CWallet::SelectCoinsByDenominations(int nDenom, CAmount nValueMin, CAmount nValueMax, std::vector& vCoinsRet, std::vector& vCoinsRet2, CAmount& nValueRet, int nPrivateSendRoundsMin, int nPrivateSendRoundsMax) { vCoinsRet.clear(); nValueRet = 0; @@ -2537,9 +2537,9 @@ bool CWallet::SelectCoinsByDenominations(int nDenom, CAmount nValueMin, CAmount CTxIn vin = CTxIn(out.tx->GetHash(),out.i); - int rounds = GetInputDarksendRounds(vin); - if(rounds >= nDarksendRoundsMax) continue; - if(rounds < nDarksendRoundsMin) continue; + int rounds = GetInputPrivateSendRounds(vin); + if(rounds >= nPrivateSendRoundsMax) continue; + if(rounds < nPrivateSendRoundsMin) continue; if(fFound100 && fFound10 && fFound1 && fFoundDot1){ //if fulfilled //we can return this for submission @@ -2574,7 +2574,7 @@ bool CWallet::SelectCoinsByDenominations(int nDenom, CAmount nValueMin, CAmount return (nValueRet >= nValueMin && fFound100 && fFound10 && fFound1 && fFoundDot1); } -bool CWallet::SelectCoinsDark(CAmount nValueMin, CAmount nValueMax, std::vector& setCoinsRet, CAmount& nValueRet, int nDarksendRoundsMin, int nDarksendRoundsMax) const +bool CWallet::SelectCoinsDark(CAmount nValueMin, CAmount nValueMax, std::vector& setCoinsRet, CAmount& nValueRet, int nPrivateSendRoundsMin, int nPrivateSendRoundsMax) const { CCoinControl *coinControl=NULL; @@ -2582,7 +2582,7 @@ bool CWallet::SelectCoinsDark(CAmount nValueMin, CAmount nValueMax, std::vector< nValueRet = 0; vector vCoins; - AvailableCoins(vCoins, true, coinControl, false, nDarksendRoundsMin < 0 ? ONLY_NONDENOMINATED_NOT1000IFMN : ONLY_DENOMINATED); + AvailableCoins(vCoins, true, coinControl, false, nPrivateSendRoundsMin < 0 ? ONLY_NONDENOMINATED_NOT1000IFMN : ONLY_DENOMINATED); set > setCoinsRet2; @@ -2600,9 +2600,9 @@ bool CWallet::SelectCoinsDark(CAmount nValueMin, CAmount nValueMax, std::vector< if(nValueRet + out.tx->vout[out.i].nValue <= nValueMax){ CTxIn vin = CTxIn(out.tx->GetHash(),out.i); - int rounds = GetInputDarksendRounds(vin); - if(rounds >= nDarksendRoundsMax) continue; - if(rounds < nDarksendRoundsMin) continue; + int rounds = GetInputPrivateSendRounds(vin); + if(rounds >= nPrivateSendRoundsMax) continue; + if(rounds < nPrivateSendRoundsMin) continue; vin.prevPubKey = out.tx->vout[out.i].scriptPubKey; // the inputs PubKey nValueRet += out.tx->vout[out.i].nValue; @@ -4081,7 +4081,7 @@ int CMerkleTx::GetDepthInMainChain(const CBlockIndex* &pindexRet, bool enableIX) } if(enableIX && nResult < 6 && IsLockedIXTransaction(GetHash())) - return nInstantXDepth + nResult; + return nInstantSendDepth + nResult; return nResult; } diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index f474ee772d..a27a32c3d4 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -631,8 +631,8 @@ public: */ bool SelectCoinsMinConf(const CAmount& nTargetValue, int nConfMine, int nConfTheirs, std::vector vCoins, std::set >& setCoinsRet, CAmount& nValueRet) const; - bool SelectCoinsDark(CAmount nValueMin, CAmount nValueMax, std::vector& setCoinsRet, CAmount& nValueRet, int nDarksendRoundsMin, int nDarksendRoundsMax) const; - bool SelectCoinsByDenominations(int nDenom, CAmount nValueMin, CAmount nValueMax, std::vector& vCoinsRet, std::vector& vCoinsRet2, CAmount& nValueRet, int nDarksendRoundsMin, int nDarksendRoundsMax); + bool SelectCoinsDark(CAmount nValueMin, CAmount nValueMax, std::vector& setCoinsRet, CAmount& nValueRet, int nPrivateSendRoundsMin, int nPrivateSendRoundsMax) const; + bool SelectCoinsByDenominations(int nDenom, CAmount nValueMin, CAmount nValueMax, std::vector& vCoinsRet, std::vector& vCoinsRet2, CAmount& nValueRet, int nPrivateSendRoundsMin, int nPrivateSendRoundsMax); bool SelectCoinsDarkDenominated(CAmount nTargetValue, std::vector& setCoinsRet, CAmount& nValueRet) const; bool HasCollateralInputs(bool fOnlyConfirmed = true) const; bool IsCollateralAmount(CAmount nInputAmount) const; @@ -641,9 +641,9 @@ public: CAmount GetTotalValue(std::vector vCoins); // get the Darksend chain depth for a given input - int GetRealInputDarksendRounds(CTxIn in, int rounds) const; + int GetRealInputPrivateSendRounds(CTxIn in, int rounds) const; // respect current settings - int GetInputDarksendRounds(CTxIn in) const; + int GetInputPrivateSendRounds(CTxIn in) const; bool IsDenominated(const CTxIn &txin) const; bool IsDenominated(const CTransaction& tx) const;