From f0192b1bb3b68cdb9055dbfcab26366ce3776120 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Sun, 5 Apr 2015 23:52:37 -0700 Subject: [PATCH 01/23] Reverting some DS changes - Some changes caused instability of DS, this should fix that. --- src/darksend.cpp | 458 ++-------------------------------------- src/darksend.h | 78 +------ src/qt/overviewpage.cpp | 24 +-- 3 files changed, 35 insertions(+), 525 deletions(-) diff --git a/src/darksend.cpp b/src/darksend.cpp index 4f4d1b295..1740f1cfd 100644 --- a/src/darksend.cpp +++ b/src/darksend.cpp @@ -130,9 +130,6 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand } if(state == POOL_STATUS_QUEUE){ - //save the relay signature info - AddRelaySignature(dsq.vchRelaySig, dsq.nBlockHeight, dsq.strSharedKey); - if (fDebug) LogPrintf("Darksend queue is ready - %s\n", addr.ToString().c_str()); PrepareDarksendDenominate(); } @@ -158,138 +155,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand dsq.time = GetTime(); } - } else if (strCommand == "dsr") { //Darksend Relay - - //* Ask a Masternode to relay an anonymous output to another Masternode *// - - std::string error = ""; - if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) { - LogPrintf("dsr -- incompatible version! \n"); - return; - } - - if(!fMasterNode){ - LogPrintf("dsr -- not a Masternode! \n"); - return; - } - - CDarkSendRelay dsr; - vRecv >> dsr; - - if(chainActive.Tip()->nHeight - dsr.nBlockHeight > 10) return; - - if(dsr.nRelayType != DARKSEND_RELAY_IN && - dsr.nRelayType != DARKSEND_RELAY_OUT && - dsr.nRelayType != DARKSEND_RELAY_SIG) return; - - - if(dsr.in == CTxIn() && dsr.nRelayType == DARKSEND_RELAY_IN) return; - if(dsr.out == CTxOut() && dsr.nRelayType == DARKSEND_RELAY_OUT) return; - if(dsr.in == CTxIn() && dsr.nRelayType == DARKSEND_RELAY_SIG) return; - - CMasternode* pmn = mnodeman.Find(dsr.vinMasternode); - if(pmn == NULL){ - LogPrintf("dsr -- unknown Masternode! %s \n", dsr.vinMasternode.ToString().c_str()); - return; - } - - /* - For added DDOS protection, clients can only relay through 20 nodes per block. - */ - int rank = mnodeman.GetMasternodeRank(activeMasternode.vin, dsr.nBlockHeight, MIN_POOL_PEER_PROTO_VERSION); - if(rank == -1 || rank > 20){ - LogPrintf("dsr -- invalid relay Masternode! %s \n", activeMasternode.vin.ToString().c_str()); - return; - } - - //check the signature from the target Masternode - std::string strMessage = boost::lexical_cast(dsr.nBlockHeight); - std::string errorMessage = ""; - if(!darkSendSigner.VerifyMessage(pmn->pubkey2, dsr.vchSig, strMessage, errorMessage)){ - LogPrintf("dsr - Got bad Masternode address signature\n"); - Misbehaving(pfrom->GetId(), 100); - return; - } - - //connect and deliver the message - if(ConnectNode((CAddress)pmn->addr, NULL, true)){ - CNode* pNode = FindNode(pmn->addr); - if(pNode) - { - pNode->PushMessage("dsai", dsr); - return; - } - } - - } else if (strCommand == "dsai") { //Darksend Anonymous Item (Input/Output/Sig) - - std::string error = ""; - if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) { - LogPrintf("dsai -- incompatible version! \n"); - return; - } - - if(!fMasterNode){ - LogPrintf("dsai -- not a Masternode! \n"); - return; - } - - CDarkSendRelay dsr; - vRecv >> dsr; - - if(chainActive.Tip()->nHeight - dsr.nBlockHeight > 10) return; - if(darkSendPool.strMasternodeSharedKey == "") return; - if(dsr.nRelayType != DARKSEND_RELAY_IN && - dsr.nRelayType != DARKSEND_RELAY_OUT && - dsr.nRelayType != DARKSEND_RELAY_SIG) return; - if(dsr.in == CTxIn() && dsr.nRelayType == DARKSEND_RELAY_IN) return; - if(dsr.out == CTxOut() && dsr.nRelayType == DARKSEND_RELAY_OUT) return; - if(dsr.in == CTxIn() && dsr.nRelayType == DARKSEND_RELAY_SIG) return; - - CMasternode* pmn = mnodeman.Find(dsr.vinMasternode); - if(pmn == NULL){ - LogPrintf("dsai -- unknown Masternode! %s \n", dsr.vinMasternode.ToString().c_str()); - return; - } - - //check the signature from the target Masternode - std::string strMessage = boost::lexical_cast(dsr.nBlockHeight); - std::string errorMessage = ""; - if(!darkSendSigner.VerifyMessage(pmn->pubkey2, dsr.vchSig, strMessage, errorMessage)){ - LogPrintf("dsai - Got bad Masternode address signature\n"); - Misbehaving(pfrom->GetId(), 100); - return; - } - - if(!dsr.VerifyMessage(darkSendPool.strMasternodeSharedKey)){ - LogPrintf("dsai - Got bad shared key signature\n"); - Misbehaving(pfrom->GetId(), 30); - return; - } - - //do we have enough users in the current session? - if(!IsSessionReady()){ - LogPrintf("dsai -- session not complete! \n"); - return; - } - - switch(dsr.nRelayType){ - case DARKSEND_RELAY_IN: - anonTx.AddInput(dsr.in); - break; - case DARKSEND_RELAY_OUT: - anonTx.AddOutput(dsr.out); - break; - case DARKSEND_RELAY_SIG: - anonTx.AddSig(dsr.in); - break; - } - - // relay to all peers that an entry was added to the pool successfully. - Check(); - - } else if (strCommand == "dsi") { //Darksend vIn - + } else if (strCommand == "dsi") { //DarkSend vIn std::string error = ""; if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) { LogPrintf("dsi -- incompatible version! \n"); @@ -617,9 +483,6 @@ void CDarksendPool::SetNull(bool clearEverything){ finalTransaction.vout.clear(); entries.clear(); - anonTx.vin.clear(); - anonTx.vout.clear(); - nTrickleInputsOutputs = 0; state = POOL_STATUS_IDLE; @@ -629,7 +492,6 @@ void CDarksendPool::SetNull(bool clearEverything){ lastEntryAccepted = 0; countEntriesAccepted = 0; lastNewBlock = 0; - fSubmitAnonymousFailed = false; sessionUsers = 0; sessionDenom = 0; @@ -637,18 +499,11 @@ void CDarksendPool::SetNull(bool clearEverything){ vecSessionCollateral.clear(); txCollateral = CTransaction(); - vchMasternodeRelaySig.clear(); - nMasternodeBlockHeight = 0; - if(clearEverything){ myEntries.clear(); sessionID = 0; } - //automatically downgrade for 11.2, blinding will be supported in 11.3/12.0 - nTrickleInputsOutputs = INT_MAX; - Downgrade(); - // -- seed random number generator (used for ordering output lists) unsigned int seed = 0; RAND_bytes((unsigned char*)&seed, sizeof(seed)); @@ -686,14 +541,10 @@ void CDarksendPool::Check() //printf("CDarksendPool::Check() %d - %d - %d\n", state, anonTx.CountEntries(), GetTimeMillis()-lastTimeChanged); // If entries is full, then move on to the next phase - if(state == POOL_STATUS_ACCEPTING_ENTRIES && ( - (int)entries.size() >= GetMaxPoolTransactions() || - (GetTimeMillis()-lastTimeChanged > 5000 && anonTx.CountEntries() > GetMaxPoolTransactions()*5) - )) + if(state == POOL_STATUS_ACCEPTING_ENTRIES && (int)entries.size() >= GetMaxPoolTransactions()) { if(fDebug) LogPrintf("CDarksendPool::Check() -- TRYING TRANSACTION \n"); UpdateState(POOL_STATUS_FINALIZE_TRANSACTION); - nCountAttempts++; } // create the finalized transaction for distribution to the clients @@ -705,26 +556,19 @@ void CDarksendPool::Check() CTransaction txNew; // make our new transaction - if((int)entries.size() >= GetMaxPoolTransactions()) { - for(unsigned int i = 0; i < entries.size(); i++){ - BOOST_FOREACH(const CTxOut& v, entries[i].vout) - txNew.vout.push_back(v); - - BOOST_FOREACH(const CTxDSIn& s, entries[i].sev) - txNew.vin.push_back(s); - } - - // shuffle the outputs for improved anonymity - std::random_shuffle ( txNew.vin.begin(), txNew.vin.end(), randomizeList); - std::random_shuffle ( txNew.vout.begin(), txNew.vout.end(), randomizeList); - } else { - BOOST_FOREACH(CTxDSIn& v, anonTx.vin) - txNew.vin.push_back((CTxIn)v); - - BOOST_FOREACH(CTxOut& v, anonTx.vout) + for(unsigned int i = 0; i < entries.size(); i++){ + BOOST_FOREACH(const CTxOut& v, entries[i].vout) txNew.vout.push_back(v); + + BOOST_FOREACH(const CTxDSIn& s, entries[i].sev) + txNew.vin.push_back(s); } + // shuffle the outputs for improved anonymity + std::random_shuffle ( txNew.vin.begin(), txNew.vin.end(), randomizeList); + std::random_shuffle ( txNew.vout.begin(), txNew.vout.end(), randomizeList); + + if(fDebug) LogPrintf("Transaction 1: %s\n", txNew.ToString().c_str()); finalTransaction = txNew; @@ -733,8 +577,6 @@ void CDarksendPool::Check() } } - //printf("Signing Status %d %d\n", state == POOL_STATUS_SIGNING, SignaturesComplete()); - // If we have all of the signatures, try to compile the transaction if(state == POOL_STATUS_SIGNING && SignaturesComplete()) { if(fDebug) LogPrintf("CDarksendPool::Check() -- SIGNING\n"); @@ -764,17 +606,13 @@ void CDarksendPool::CheckFinalTransaction() // See if the transaction is valid if (!txNew.AcceptToMemoryPool(false)) { - if(nCountAttempts > 60) { - LogPrintf("CDarksendPool::Check() - CommitTransaction : Error: Transaction not valid\n"); - SetNull(); - pwalletMain->Lock(); - } + LogPrintf("CDarksendPool::Check() - CommitTransaction : Error: Transaction not valid\n"); + SetNull(); + pwalletMain->Lock(); // not much we can do in this case] UpdateState(POOL_STATUS_ACCEPTING_ENTRIES); - - if(!fSubmitAnonymousFailed && nCountAttempts > 30) - fSubmitAnonymousFailed = true; + RelayCompletedTransaction(sessionID, true, "Transaction not valid, please try again"); return; } @@ -1039,13 +877,6 @@ void CDarksendPool::CheckTimeout(){ c++; } - if(!fSubmitAnonymousFailed && !fMasterNode && state == POOL_STATUS_ACCEPTING_ENTRIES){ - if(GetTimeMillis()-lastTimeChanged >= (DARKSEND_DOWNGRADE_TIMEOUT*1000)+addLagTime){ - lastTimeChanged = GetTimeMillis(); - Downgrade(); - } - } - if(GetTimeMillis()-lastTimeChanged >= (DARKSEND_QUEUE_TIMEOUT*1000)+addLagTime){ lastTimeChanged = GetTimeMillis(); @@ -1068,7 +899,6 @@ void CDarksendPool::CheckTimeout(){ } if(state == POOL_STATUS_SIGNING && GetTimeMillis()-lastTimeChanged >= (DARKSEND_SIGNING_TIMEOUT*1000)+addLagTime ) { - if(fSubmitAnonymousFailed){ if(fDebug) LogPrintf("CDarksendPool::CheckTimeout() -- Session timed out -- restting\n"); ChargeFees(); SetNull(); @@ -1077,13 +907,6 @@ void CDarksendPool::CheckTimeout(){ UpdateState(POOL_STATUS_ERROR); lastMessage = _("Signing timed out, please resubmit."); - } else { //Downgrade and try again - Downgrade(); - finalTransaction.vin.clear(); - finalTransaction.vout.clear(); - UpdateState(POOL_STATUS_ACCEPTING_ENTRIES); - lastMessage = _("Downgrading and trying again."); - } } } @@ -1099,21 +922,13 @@ void CDarksendPool::CheckForCompleteQueue(){ // which is the active state right before merging the transaction // if(state == POOL_STATUS_QUEUE && sessionUsers == GetMaxPoolTransactions()) { - LogPrintf("Q ready"); UpdateState(POOL_STATUS_ACCEPTING_ENTRIES); - if(strMasternodeSharedKey == ""){ - CKey secret; - secret.MakeNewKey(false); - strMasternodeSharedKey = CBitcoinSecret(secret).ToString(); - } - CDarksendQueue dsq; dsq.nDenom = sessionDenom; dsq.vin = activeMasternode.vin; dsq.time = GetTime(); dsq.ready = true; - dsq.SetSharedKey(strMasternodeSharedKey); dsq.Sign(); dsq.Relay(); } @@ -1299,13 +1114,6 @@ bool CDarksendPool::AddScriptSig(const CTxIn& newVin){ // Check to make sure everything is signed bool CDarksendPool::SignaturesComplete(){ - bool fFoundIncomplete = false; - BOOST_FOREACH(CTxDSIn in, anonTx.vin){ - if(!in.fHasSig) - fFoundIncomplete = true; - } - if(fFoundIncomplete == false) return true; - BOOST_FOREACH(const CDarkSendEntry& v, entries) { BOOST_FOREACH(const CTxDSIn& s, v.sev){ if(!s.fHasSig) return false; @@ -1388,9 +1196,7 @@ void CDarksendPool::SendDarksendDenominate(std::vector& vin, std::vector< e.Add(vin, amount, txCollateral, vout); myEntries.push_back(e); - // submit inputs/outputs through relays - TrickleInputsOutputs(); - + RelayIn(myEntries[0].sev, myEntries[0].amount, txCollateral, myEntries[0].vout); Check(); } @@ -1448,7 +1254,6 @@ bool CDarksendPool::StatusUpdate(int newState, int newEntriesCount, int newAccep // bool CDarksendPool::SignFinalTransaction(CTransaction& finalTransactionNew, CNode* node){ if(fMasterNode) return false; - if(fDebug) LogPrintf("CDarksendPool::SignFinalTransaction - Got Finalized Transaction - fSubmitAnonymousFailed %d\n", fSubmitAnonymousFailed); finalTransaction = finalTransactionNew; LogPrintf("CDarksendPool::SignFinalTransaction %s\n", finalTransaction.ToString().c_str()); @@ -1473,10 +1278,6 @@ bool CDarksendPool::SignFinalTransaction(CTransaction& finalTransactionNew, CNod if(mine >= 0){ //might have to do this one input at a time? - //already signed - CScript scriptOld = finalTransaction.vin[mine].scriptSig; - if(!fSubmitAnonymousFailed && sigs.size() > 7) break; //send 7 each signing - int foundOutputs = 0; int64_t nValue1 = 0; int64_t nValue2 = 0; @@ -1498,7 +1299,7 @@ bool CDarksendPool::SignFinalTransaction(CTransaction& finalTransactionNew, CNod // in this case, something went wrong and we'll refuse to sign. It's possible we'll be charged collateral. But that's // better then signing if the transaction doesn't look like what we wanted. LogPrintf("CDarksendPool::Sign - My entries are not correct! Refusing to sign. %d entries %d target. \n", foundOutputs, targetOuputs); - TrickleInputsOutputs(); + return false; } @@ -1508,8 +1309,6 @@ bool CDarksendPool::SignFinalTransaction(CTransaction& finalTransactionNew, CNod // not sure what to do here, it will timeout...? } - if(scriptOld != CScript() && finalTransaction.vin[mine].scriptSig == scriptOld) continue; - sigs.push_back(finalTransaction.vin[mine]); if(fDebug) LogPrintf(" -- dss %d %d %s\n", mine, (int)sigs.size(), finalTransaction.vin[mine].scriptSig.ToString().c_str()); } @@ -1519,22 +1318,10 @@ bool CDarksendPool::SignFinalTransaction(CTransaction& finalTransactionNew, CNod if(fDebug) LogPrintf("CDarksendPool::Sign - txNew:\n%s", finalTransaction.ToString().c_str()); } - if(!fSubmitAnonymousFailed){ - //resubmit some other sigs from the transaction, so nodes can't tell who's inputs/outputs are whos - BOOST_FOREACH(CTxIn& in, finalTransaction.vin) - if((rand() % 100) > 75 && in.scriptSig != CScript()) - sigs.push_back(in); + // push all of our signatures to the Masternode + if(sigs.size() > 0 && node != NULL) + node->PushMessage("dss", sigs); - std::random_shuffle ( sigs.begin(), sigs.end(), randomizeList); - - LogPrintf("sigs count %d\n", (int)sigs.size()); - - RelaySignaturesAnon(sigs); - } else { - // push all of our signatures to the Masternode - if(sigs.size() > 0 && node != NULL) - node->PushMessage("dss", sigs); - } return true; } @@ -1867,90 +1654,6 @@ bool CDarksendPool::PrepareDarksendDenominate() return false; } -bool CDarksendPool::Downgrade() -{ - - if(fSubmitAnonymousFailed) return true; - if(myEntries.size() == 0) return false; - - fSubmitAnonymousFailed = true; - //LogPrintf("CDarksendPool::Downgrade() : Downgrading and submitting directly\n"); - - // relay our entry to the master node - RelayIn(myEntries[0].sev, myEntries[0].amount, txCollateral, myEntries[0].vout); - - return true; -} - -struct SortByTimesSent -{ - bool operator()(const CTxDSIn & t1, - const CTxDSIn & t2) const - { - return t1.nSentTimes > t2.nSentTimes; - } - - bool operator()(const CTxDSOut & t1, - const CTxDSOut & t2) const - { - return t1.nSentTimes > t2.nSentTimes; - } -}; - -bool CDarksendPool::TrickleInputsOutputs() -{ - if(nTrickleInputsOutputs >= 20) { - Downgrade(); - return true; - } - if(myEntries.size() == 0) return false; - - std::vector vin; - std::vector vout; - - sort(myEntries[0].sev.rbegin(), myEntries[0].sev.rend(), SortByTimesSent()); - sort(myEntries[0].vout.rbegin(), myEntries[0].vout.rend(), SortByTimesSent()); - - int nCount1 = 0; - int nCount2 = 0; - int nMax = max(nTrickleInputsOutputs*3, 15)+3; - - //trickle some of our inputs/outputs - BOOST_FOREACH(CTxDSIn& in, myEntries[0].sev) { - if(nCount1 < (rand() % nMax)+5){ - in.nSentTimes++; - vin.push_back((CTxIn)in); - nCount1++; - } else {break;} - } - - BOOST_FOREACH(CTxDSOut& out, myEntries[0].vout) { - if(nCount2 < (rand() % nMax)+5){ - out.nSentTimes++; - vout.push_back((CTxOut)out); - nCount2++; - } else {break;} - } - - //resubmit some other inputs/outputs from the transaction, so nodes can't tell who's inputs/outputs are whos - BOOST_FOREACH(CTxIn& in, finalTransaction.vin) - if((rand() % 100) > 75) - vin.push_back(in); - - BOOST_FOREACH(CTxOut& out, finalTransaction.vout) - if((rand() % 100) > 75) - vout.push_back(out); - - //shuffle everything around - std::random_shuffle ( vin.begin(), vin.end(), randomizeList); - std::random_shuffle ( vout.begin(), vout.end(), randomizeList); - - LogPrintf("CDarksendPool::TrickleInputsOutputs() : Sending %d inputs and %d outputs\n", (int)vin.size(), (int)vout.size()); - RelayInAnon(vin, vout); - nTrickleInputsOutputs++; - return true; -} - bool CDarksendPool::SendRandomPaymentToSelf() { int64_t nBalance = pwalletMain->GetBalance(); @@ -2140,7 +1843,6 @@ bool CDarksendPool::IsCompatibleWithSession(int64_t nDenom, CTransaction txColla dsq.vin = activeMasternode.vin; dsq.time = GetTime(); dsq.Sign(); - strMasternodeSharedKey = dsq.strSharedKey; dsq.Relay(); } @@ -2400,29 +2102,9 @@ bool CDarksendQueue::Sign() return false; } - // -- second signature, for proving access to the anonymous relay system - - nBlockHeight = chainActive.Tip()->nHeight; //sign with our current blockheight - strMessage = boost::lexical_cast(nBlockHeight); - - if(!darkSendSigner.SignMessage(strMessage, errorMessage, vchRelaySig, key2)) { - LogPrintf("CDarksendQueue():Relay - Sign message failed"); - return false; - } - - if(!darkSendSigner.VerifyMessage(pubkey2, vchRelaySig, strMessage, errorMessage)) { - LogPrintf("CDarksendQueue():Relay - Verify message failed"); - return false; - } - return true; } -void CDarksendQueue::SetSharedKey(std::string strSharedKeyIn) -{ - strSharedKey = strSharedKeyIn; -} - bool CDarksendQueue::Relay() { @@ -2448,18 +2130,6 @@ bool CDarksendQueue::CheckSignature() return error("CDarksendQueue::CheckSignature() - Got bad Masternode address signature %s \n", vin.ToString().c_str()); } - // -- second signature, for proving access to the anonymous relay system - - if(ready) - { - strMessage = boost::lexical_cast(nBlockHeight); - - if(!darkSendSigner.VerifyMessage(pmn->pubkey2, vchRelaySig, strMessage, errorMessage)) { - LogPrintf("CDarksendQueue():CheckSignature - Verify message failed"); - return false; - } - } - return true; } @@ -2476,38 +2146,6 @@ void CDarksendPool::RelayFinalTransaction(const int sessionID, const CTransactio } } -void CDarksendPool::RelaySignaturesAnon(std::vector& vin) -{ - CTxOut emptyOut; - - BOOST_FOREACH(CTxIn& in, vin){ - LogPrintf("RelaySignaturesAnon - sig %s\n", in.ToString().c_str()); - CDarkSendRelay dsr(pSubmittedToMasternode->vin, vchMasternodeRelaySig, nMasternodeBlockHeight, DARKSEND_RELAY_SIG, in, emptyOut); - dsr.Sign(strMasternodeSharedKey); - dsr.Relay(); - } -} - -void CDarksendPool::RelayInAnon(std::vector& vin, std::vector& vout) -{ - CTxOut emptyOut; - CTxIn emptyIn; - - BOOST_FOREACH(CTxIn& in, vin){ - LogPrintf("RelayInAnon - in %s\n", in.ToString().c_str()); - CDarkSendRelay dsr(pSubmittedToMasternode->vin, vchMasternodeRelaySig, nMasternodeBlockHeight, DARKSEND_RELAY_IN, in, emptyOut); - dsr.Sign(strMasternodeSharedKey); - dsr.Relay(); - } - - BOOST_FOREACH(CTxOut& out, vout){ - LogPrintf("RelayInAnon - out %s\n", out.ToString().c_str()); - CDarkSendRelay dsr(pSubmittedToMasternode->vin, vchMasternodeRelaySig, nMasternodeBlockHeight, DARKSEND_RELAY_OUT, emptyIn, out); - dsr.Sign(strMasternodeSharedKey); - dsr.Relay(); - } -} - void CDarksendPool::RelayIn(const std::vector& vin, const int64_t& nAmount, const CTransaction& txCollateral, const std::vector& vout) { @@ -2544,57 +2182,6 @@ void CDarksendPool::RelayCompletedTransaction(const int sessionID, const bool er pnode->PushMessage("dsc", sessionID, error, errorMessage); } -bool CDSAnonTx::AddOutput(const CTxOut out){ - if(fDebug) LogPrintf("CDSAnonTx::AddOutput -- new %s\n", out.ToString().substr(0,24).c_str()); - - BOOST_FOREACH(CTxOut& out2, vout) - if(out2.nValue == out.nValue && out.scriptPubKey == out2.scriptPubKey) - return false; - - vout.push_back(out); - std::random_shuffle ( vout.begin(), vout.end(), randomizeList); - ClearSigs(); - - return true; -} - -bool CDSAnonTx::AddInput(const CTxIn in){ - if(fDebug) LogPrintf("CDSAnonTx::AddInput -- new %s\n", in.ToString().substr(0,24).c_str()); - - //already have this input - BOOST_FOREACH(CTxDSIn& in2, vin) - if(in2.prevout == in.prevout && in.nSequence == in2.nSequence) - return false; - - vin.push_back(in); - std::random_shuffle ( vin.begin(), vin.end(), randomizeList); - ClearSigs(); - - return true; -} - -bool CDSAnonTx::ClearSigs(){ - BOOST_FOREACH(CTxDSIn& in, vin) - in.scriptSig = CScript(); - - return true; -} - -bool CDSAnonTx::AddSig(const CTxIn newIn){ - if(fDebug) LogPrintf("CDSAnonTx::AddSig -- new %s\n", newIn.ToString().substr(0,24).c_str()); - - BOOST_FOREACH(CTxDSIn& in, vin){ - if(newIn.prevout == in.prevout && in.nSequence == newIn.nSequence){ - in.scriptSig = newIn.scriptSig; - in.prevPubKey = newIn.prevPubKey; - in.fHasSig = true; - return true; - } - } - - return false; -} - //TODO: Rename/move to core void ThreadCheckDarkSendPool() { @@ -2613,10 +2200,7 @@ void ThreadCheckDarkSendPool() MilliSleep(1000); //LogPrintf("ThreadCheckDarkSendPool::check timeout\n"); - if(c % 10 == 0) darkSendPool.Check(); - if(c % 3 == 0) darkSendPool.TrickleInputsOutputs(); darkSendPool.CheckTimeout(); - darkSendPool.CheckForCompleteQueue(); if(c % 60 == 0) { diff --git a/src/darksend.h b/src/darksend.h index ea4b6aa7d..753c90a6c 100644 --- a/src/darksend.h +++ b/src/darksend.h @@ -39,9 +39,8 @@ class CActiveMasternode; #define MASTERNODE_REJECTED 0 #define MASTERNODE_RESET -1 -#define DARKSEND_QUEUE_TIMEOUT 180 // in seconds -#define DARKSEND_SIGNING_TIMEOUT 30 // in seconds -#define DARKSEND_DOWNGRADE_TIMEOUT 60 // in seconds +#define DARKSEND_QUEUE_TIMEOUT 120 +#define DARKSEND_SIGNING_TIMEOUT 30 // used for anonymous relaying of inputs/outputs/sigs #define DARKSEND_RELAY_IN 1 @@ -92,9 +91,7 @@ public: } }; -/** A clients transaction in the Darksend pool - * -- holds the input/output mapping for each user in the pool - */ +// A clients transaction in the darksend pool class CDarkSendEntry { public: @@ -152,20 +149,12 @@ public: bool ready; //ready for submit std::vector vchSig; - //information used for the anonymous relay system - int nBlockHeight; - std::vector vchRelaySig; - std::string strSharedKey; // shared key - CDarksendQueue() { nDenom = 0; vin = CTxIn(); time = 0; vchSig.clear(); - vchRelaySig.clear(); - nBlockHeight = 0; - strSharedKey = ""; ready = false; } @@ -176,12 +165,6 @@ public: READWRITE(time); READWRITE(ready); READWRITE(vchSig); - - if(ready){ - READWRITE(vchRelaySig); - READWRITE(nBlockHeight); - READWRITE(strSharedKey); - } ) bool GetAddress(CService &addr) @@ -207,9 +190,6 @@ public: return false; } - /// Set the 'strSharedKey' - void SetSharedKey(std::string strSharedKey); - /** Sign this Darksend transaction * \return true if all conditions are met: * 1) we have an active Masternode, @@ -258,32 +238,6 @@ public: bool VerifyMessage(CPubKey pubkey, std::vector& vchSig, std::string strMessage, std::string& errorMessage); }; -/** Build a transaction anonymously - */ -class CDSAnonTx -{ -public: - std::vector vin; // collection of inputs - std::vector vout; // collection of outputs - - /// Is the transaction valid? (TODO: not defined - remove? or code?) - bool IsTransactionValid(); - /// Add an output - bool AddOutput(const CTxOut out); - /// Add an input - bool AddInput(const CTxIn in); - /// Clear Signatures - bool ClearSigs(); - /// Add Signature - bool AddSig(const CTxIn in); - /// Count the number of entries in the transaction - int CountEntries() {return (int)vin.size() + (int)vout.size();} -}; - -/// TODO: not defined - remove? -void ConnectToDarkSendMasterNodeWinner(); - - /** Used to keep track of current status of Darksend pool */ class CDarksendPool @@ -293,9 +247,6 @@ public: std::vector myEntries; // clients entries std::vector entries; // Masternode entries CTransaction finalTransaction; // the finalized transaction ready for signing - CDSAnonTx anonTx; // anonymous inputs/outputs - bool fSubmitAnonymousFailed; // initally false, will change to true if when attempts > 5 - int nCountAttempts; // number of submitted attempts int64_t lastTimeChanged; // last time the 'state' changed, in UTC milliseconds int64_t lastAutoDenomination; // TODO; not used - Delete? @@ -334,12 +285,6 @@ public: //debugging data std::string strAutoDenomResult; - // used for securing the anonymous relay system - vector vchMasternodeRelaySig; - int nMasternodeBlockHeight; - std::string strMasternodeSharedKey; - int nTrickleInputsOutputs; - CDarksendPool() { /* Darksend uses collateral addresses to trust parties entering the pool @@ -351,8 +296,6 @@ public: txCollateral = CTransaction(); minBlockSpacing = 1; lastNewBlock = 0; - strMasternodeSharedKey = ""; - nTrickleInputsOutputs = 0; SetNull(); } @@ -390,9 +333,6 @@ public: bool SetCollateralAddress(std::string strAddress); void Reset(); - bool Downgrade(); - bool TrickleInputsOutputs(); - void SetNull(bool clearEverything=false); void UnlockCoins(); @@ -492,18 +432,6 @@ public: bool IsCollateralValid(const CTransaction& txCollateral); /// Add a clients entry to the pool bool AddEntry(const std::vector& newInput, const int64_t& nAmount, const CTransaction& txCollateral, const std::vector& newOutput, std::string& error); - - /// Add an anonymous output/inputs/sig - bool AddAnonymousOutput(const CTxOut& out) {return anonTx.AddOutput(out);} - bool AddAnonymousInput(const CTxIn& in) {return anonTx.AddInput(in);} - bool AddAnonymousSig(const CTxIn& in) {return anonTx.AddSig(in);} - bool AddRelaySignature(vector vchMasternodeRelaySigIn, int nMasternodeBlockHeightIn, std::string strSharedKey) { - vchMasternodeRelaySig = vchMasternodeRelaySigIn; - nMasternodeBlockHeight = nMasternodeBlockHeightIn; - strMasternodeSharedKey = strSharedKey; - return true; - } - /// Add signature to a vin bool AddScriptSig(const CTxIn& newVin); /// Check that all inputs are signed. (Are all inputs signed?) diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 77ad579df..597e68674 100755 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -375,12 +375,10 @@ void OverviewPage::darkSendStatus() /* ** @TODO this string creation really needs some clean ups ---vertoe ** */ std::ostringstream convert; - if(state == POOL_STATUS_IDLE) { - convert << tr("Darksend is idle.").toStdString(); - } else if(state == POOL_STATUS_ACCEPTING_ENTRIES) { + if(state == POOL_STATUS_ACCEPTING_ENTRIES) { if(entries == 0) { if(darkSendPool.strAutoDenomResult.size() == 0){ - convert << tr("Mixing in progress...").toStdString(); + convert << tr("Darksend is idle.").toStdString(); } else { convert << darkSendPool.strAutoDenomResult; } @@ -393,15 +391,15 @@ void OverviewPage::darkSendStatus() } } else { if(showingDarkSendMessage % 70 <= 40) convert << tr("Submitted following entries to masternode:").toStdString() << " " << entries << "/" << darkSendPool.GetMaxPoolTransactions(); - else if(showingDarkSendMessage % 70 <= 50) convert << tr("Submitted to masternode, waiting for more entries").toStdString() << " (" << entries << "/" << darkSendPool.GetMaxPoolTransactions() << " ) ."; - else if(showingDarkSendMessage % 70 <= 60) convert << tr("Submitted to masternode, waiting for more entries").toStdString() << " (" << entries << "/" << darkSendPool.GetMaxPoolTransactions() << " ) .."; - else if(showingDarkSendMessage % 70 <= 70) convert << tr("Submitted to masternode, waiting for more entries").toStdString() << " (" << entries << "/" << darkSendPool.GetMaxPoolTransactions() << " ) ..."; + else if(showingDarkSendMessage % 70 <= 50) convert << tr("Submitted to masternode, Waiting for more entries").toStdString() << " (" << entries << "/" << darkSendPool.GetMaxPoolTransactions() << " ) ."; + else if(showingDarkSendMessage % 70 <= 60) convert << tr("Submitted to masternode, Waiting for more entries").toStdString() << " (" << entries << "/" << darkSendPool.GetMaxPoolTransactions() << " ) .."; + else if(showingDarkSendMessage % 70 <= 70) convert << tr("Submitted to masternode, Waiting for more entries").toStdString() << " (" << entries << "/" << darkSendPool.GetMaxPoolTransactions() << " ) ..."; } } else if(state == POOL_STATUS_SIGNING) { if(showingDarkSendMessage % 70 <= 10) convert << tr("Found enough users, signing ...").toStdString(); - else if(showingDarkSendMessage % 70 <= 20) convert << tr("Found enough users, signing ( waiting").toStdString() << ". )"; - else if(showingDarkSendMessage % 70 <= 30) convert << tr("Found enough users, signing ( waiting").toStdString() << ".. )"; - else if(showingDarkSendMessage % 70 <= 40) convert << tr("Found enough users, signing ( waiting").toStdString() << "... )"; + else if(showingDarkSendMessage % 70 <= 20) convert << tr("Found enough users, signing ( waiting. )").toStdString(); + else if(showingDarkSendMessage % 70 <= 30) convert << tr("Found enough users, signing ( waiting.. )").toStdString(); + else if(showingDarkSendMessage % 70 <= 40) convert << tr("Found enough users, signing ( waiting... )").toStdString(); } else if(state == POOL_STATUS_TRANSMISSION) { convert << tr("Transmitting final transaction.").toStdString(); } else if (state == POOL_STATUS_IDLE) { @@ -413,9 +411,9 @@ void OverviewPage::darkSendStatus() } else if(state == POOL_STATUS_SUCCESS) { convert << tr("Darksend request complete:").toStdString() << " " << darkSendPool.lastMessage; } else if(state == POOL_STATUS_QUEUE) { - if(showingDarkSendMessage % 70 <= 50) convert << tr("Submitted to masternode, waiting in queue").toStdString() << " ."; - else if(showingDarkSendMessage % 70 <= 60) convert << tr("Submitted to masternode, waiting in queue").toStdString() << " .."; - else if(showingDarkSendMessage % 70 <= 70) convert << tr("Submitted to masternode, waiting in queue").toStdString() << " ..."; + if(showingDarkSendMessage % 70 <= 50) convert << tr("Submitted to masternode, waiting in queue .").toStdString(); + else if(showingDarkSendMessage % 70 <= 60) convert << tr("Submitted to masternode, waiting in queue ..").toStdString(); + else if(showingDarkSendMessage % 70 <= 70) convert << tr("Submitted to masternode, waiting in queue ...").toStdString(); } else { convert << tr("Unknown state:").toStdString() << " id = " << state; } From 18828b00ef9cc368f4b9a898d6e6ee8b67fd01c1 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Mon, 6 Apr 2015 08:32:43 -0700 Subject: [PATCH 02/23] fixed overviewpage.cpp --- src/qt/overviewpage.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 597e68674..77ad579df 100755 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -375,10 +375,12 @@ void OverviewPage::darkSendStatus() /* ** @TODO this string creation really needs some clean ups ---vertoe ** */ std::ostringstream convert; - if(state == POOL_STATUS_ACCEPTING_ENTRIES) { + if(state == POOL_STATUS_IDLE) { + convert << tr("Darksend is idle.").toStdString(); + } else if(state == POOL_STATUS_ACCEPTING_ENTRIES) { if(entries == 0) { if(darkSendPool.strAutoDenomResult.size() == 0){ - convert << tr("Darksend is idle.").toStdString(); + convert << tr("Mixing in progress...").toStdString(); } else { convert << darkSendPool.strAutoDenomResult; } @@ -391,15 +393,15 @@ void OverviewPage::darkSendStatus() } } else { if(showingDarkSendMessage % 70 <= 40) convert << tr("Submitted following entries to masternode:").toStdString() << " " << entries << "/" << darkSendPool.GetMaxPoolTransactions(); - else if(showingDarkSendMessage % 70 <= 50) convert << tr("Submitted to masternode, Waiting for more entries").toStdString() << " (" << entries << "/" << darkSendPool.GetMaxPoolTransactions() << " ) ."; - else if(showingDarkSendMessage % 70 <= 60) convert << tr("Submitted to masternode, Waiting for more entries").toStdString() << " (" << entries << "/" << darkSendPool.GetMaxPoolTransactions() << " ) .."; - else if(showingDarkSendMessage % 70 <= 70) convert << tr("Submitted to masternode, Waiting for more entries").toStdString() << " (" << entries << "/" << darkSendPool.GetMaxPoolTransactions() << " ) ..."; + else if(showingDarkSendMessage % 70 <= 50) convert << tr("Submitted to masternode, waiting for more entries").toStdString() << " (" << entries << "/" << darkSendPool.GetMaxPoolTransactions() << " ) ."; + else if(showingDarkSendMessage % 70 <= 60) convert << tr("Submitted to masternode, waiting for more entries").toStdString() << " (" << entries << "/" << darkSendPool.GetMaxPoolTransactions() << " ) .."; + else if(showingDarkSendMessage % 70 <= 70) convert << tr("Submitted to masternode, waiting for more entries").toStdString() << " (" << entries << "/" << darkSendPool.GetMaxPoolTransactions() << " ) ..."; } } else if(state == POOL_STATUS_SIGNING) { if(showingDarkSendMessage % 70 <= 10) convert << tr("Found enough users, signing ...").toStdString(); - else if(showingDarkSendMessage % 70 <= 20) convert << tr("Found enough users, signing ( waiting. )").toStdString(); - else if(showingDarkSendMessage % 70 <= 30) convert << tr("Found enough users, signing ( waiting.. )").toStdString(); - else if(showingDarkSendMessage % 70 <= 40) convert << tr("Found enough users, signing ( waiting... )").toStdString(); + else if(showingDarkSendMessage % 70 <= 20) convert << tr("Found enough users, signing ( waiting").toStdString() << ". )"; + else if(showingDarkSendMessage % 70 <= 30) convert << tr("Found enough users, signing ( waiting").toStdString() << ".. )"; + else if(showingDarkSendMessage % 70 <= 40) convert << tr("Found enough users, signing ( waiting").toStdString() << "... )"; } else if(state == POOL_STATUS_TRANSMISSION) { convert << tr("Transmitting final transaction.").toStdString(); } else if (state == POOL_STATUS_IDLE) { @@ -411,9 +413,9 @@ void OverviewPage::darkSendStatus() } else if(state == POOL_STATUS_SUCCESS) { convert << tr("Darksend request complete:").toStdString() << " " << darkSendPool.lastMessage; } else if(state == POOL_STATUS_QUEUE) { - if(showingDarkSendMessage % 70 <= 50) convert << tr("Submitted to masternode, waiting in queue .").toStdString(); - else if(showingDarkSendMessage % 70 <= 60) convert << tr("Submitted to masternode, waiting in queue ..").toStdString(); - else if(showingDarkSendMessage % 70 <= 70) convert << tr("Submitted to masternode, waiting in queue ...").toStdString(); + if(showingDarkSendMessage % 70 <= 50) convert << tr("Submitted to masternode, waiting in queue").toStdString() << " ."; + else if(showingDarkSendMessage % 70 <= 60) convert << tr("Submitted to masternode, waiting in queue").toStdString() << " .."; + else if(showingDarkSendMessage % 70 <= 70) convert << tr("Submitted to masternode, waiting in queue").toStdString() << " ..."; } else { convert << tr("Unknown state:").toStdString() << " id = " << state; } From d928a532341baee158547c1f5af00b26e279ea47 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Mon, 6 Apr 2015 08:39:48 -0700 Subject: [PATCH 03/23] DS Working pretty well --- src/darksend.cpp | 64 +++++++++++++++++------------------------------- src/darksend.h | 22 ++++++++++++++--- 2 files changed, 42 insertions(+), 44 deletions(-) diff --git a/src/darksend.cpp b/src/darksend.cpp index 1740f1cfd..7335e3f5d 100644 --- a/src/darksend.cpp +++ b/src/darksend.cpp @@ -278,7 +278,6 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand } } else if (strCommand == "dssu") { //Darksend status update - if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) { return; } @@ -325,8 +324,8 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand } if(success){ - CheckFinalTransaction(); - RelayStatus(sessionID, GetState(), GetEntriesCount(), MASTERNODE_RESET); + darkSendPool.Check(); + RelayStatus(darkSendPool.sessionID, darkSendPool.GetState(), darkSendPool.GetEntriesCount(), MASTERNODE_RESET); } } else if (strCommand == "dsf") { //Darksend Final tx if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) { @@ -610,7 +609,7 @@ void CDarksendPool::CheckFinalTransaction() SetNull(); pwalletMain->Lock(); - // not much we can do in this case] + // not much we can do in this case UpdateState(POOL_STATUS_ACCEPTING_ENTRIES); RelayCompletedTransaction(sessionID, true, "Transaction not valid, please try again"); return; @@ -880,14 +879,7 @@ void CDarksendPool::CheckTimeout(){ if(GetTimeMillis()-lastTimeChanged >= (DARKSEND_QUEUE_TIMEOUT*1000)+addLagTime){ lastTimeChanged = GetTimeMillis(); - ChargeFees(); - // reset session information for the queue query stage (before entering a Masternode, clients will send a queue request to make sure they're compatible denomination wise) - sessionUsers = 0; - sessionDenom = 0; - sessionFoundMasternode = false; - vecSessionCollateral.clear(); - - UpdateState(POOL_STATUS_ACCEPTING_ENTRIES); + SetNull(true); } } else if(GetTimeMillis()-lastTimeChanged >= (DARKSEND_QUEUE_TIMEOUT*1000)+addLagTime){ if(fDebug) LogPrintf("CDarksendPool::CheckTimeout() -- Session timed out (30s) -- resetting\n"); @@ -895,7 +887,7 @@ void CDarksendPool::CheckTimeout(){ UnlockCoins(); UpdateState(POOL_STATUS_ERROR); - lastMessage = _("Session timed out (30 seconds), please resubmit."); + lastMessage = _("Session timed out, please resubmit."); } if(state == POOL_STATUS_SIGNING && GetTimeMillis()-lastTimeChanged >= (DARKSEND_SIGNING_TIMEOUT*1000)+addLagTime ) { @@ -1086,7 +1078,7 @@ bool CDarksendPool::AddScriptSig(const CTxIn& newVin){ BOOST_FOREACH(const CDarkSendEntry& v, entries) { BOOST_FOREACH(const CTxDSIn& s, v.sev){ if(s.scriptSig == newVin.scriptSig) { - LogPrintf("CDarksendPool::AddScriptSig - already exists \n"); + printf("CDarksendPool::AddScriptSig - already exists \n"); return false; } } @@ -1103,7 +1095,12 @@ bool CDarksendPool::AddScriptSig(const CTxIn& newVin){ if(newVin.prevout == vin.prevout && vin.nSequence == newVin.nSequence){ vin.scriptSig = newVin.scriptSig; vin.prevPubKey = newVin.prevPubKey; - if(fDebug) LogPrintf("CDarksendPool::AddScriptSig -- adding to finalTransaction %s\n", newVin.scriptSig.ToString().substr(0,24).c_str()); + if(fDebug) LogPrintf("CDarkSendPool::AddScriptSig -- adding to finalTransaction %s\n", newVin.scriptSig.ToString().substr(0,24).c_str()); + } + } + for(unsigned int i = 0; i < entries.size(); i++){ + if(entries[i].AddSig(newVin)){ + if(fDebug) LogPrintf("CDarkSendPool::AddScriptSig -- adding %s\n", newVin.scriptSig.ToString().substr(0,24).c_str()); return true; } } @@ -1480,6 +1477,7 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready) // initial phase, find a Masternode if(!sessionFoundMasternode){ int nUseQueue = rand()%100; + UpdateState(POOL_STATUS_ACCEPTING_ENTRIES); sessionTotalValue = pwalletMain->GetTotalValue(vCoins); @@ -1552,15 +1550,15 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready) pNode->PushMessage("dsa", sessionDenom, txCollateral); LogPrintf("DoAutomaticDenominating --- connected (from queue), sending dsa for %d %d - %s\n", sessionDenom, GetDenominationsByAmount(sessionTotalValue), pNode->addr.ToString().c_str()); strAutoDenomResult = ""; + dsq.time = 0; //remove node return true; } } else { LogPrintf("DoAutomaticDenominating --- error connecting \n"); strAutoDenomResult = _("Error connecting to Masternode."); + dsq.time = 0; //remove node return DoAutomaticDenominating(); } - - dsq.time = 0; //remove node } } @@ -1802,6 +1800,8 @@ bool CDarksendPool::CreateDenominated(int64_t nTotalValue) bool CDarksendPool::IsCompatibleWithEntries(std::vector& vout) { + if(GetDenominations(vout) == 0) return false; + BOOST_FOREACH(const CDarkSendEntry v, entries) { LogPrintf(" IsCompatibleWithEntries %d %d\n", GetDenominations(vout), GetDenominations(v.vout)); /* @@ -1851,8 +1851,8 @@ bool CDarksendPool::IsCompatibleWithSession(int64_t nDenom, CTransaction txColla return true; } - if((state != POOL_STATUS_IDLE && state != POOL_STATUS_QUEUE) || sessionUsers >= GetMaxPoolTransactions()){ - if((state != POOL_STATUS_IDLE && state != POOL_STATUS_QUEUE)) strReason = _("Incompatible mode."); + 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 >= 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; @@ -1863,12 +1863,7 @@ bool CDarksendPool::IsCompatibleWithSession(int64_t nDenom, CTransaction txColla return false; } - if(state == POOL_STATUS_IDLE){ - LogPrintf("CDarksendPool::IsCompatibleWithSession - Pool is open to new entries\n"); - UpdateState(POOL_STATUS_ACCEPTING_ENTRIES); - } - - LogPrintf("CDarksendPool::IsCompatibleWithSession - compatible\n"); + LogPrintf("CDarkSendPool::IsCompatibleWithSession - compatible\n"); sessionUsers++; lastTimeChanged = GetTimeMillis(); @@ -2201,6 +2196,7 @@ void ThreadCheckDarkSendPool() //LogPrintf("ThreadCheckDarkSendPool::check timeout\n"); darkSendPool.CheckTimeout(); + darkSendPool.CheckForCompleteQueue(); if(c % 60 == 0) { @@ -2252,22 +2248,8 @@ void ThreadCheckDarkSendPool() vecMasternodesUsed.clear(); } - //auto denom every 2.5 minutes (liquidity provides try less often) - if(c % 60*(nLiquidityProvider+1) == 0){ - if(nLiquidityProvider!=0){ - int nRand = rand() % (101+nLiquidityProvider); - //about 1/100 chance of starting over after 4 rounds. - if(nRand == 50+nLiquidityProvider && pwalletMain->GetAverageAnonymizedRounds() > 8){ - darkSendPool.SendRandomPaymentToSelf(); - int nLeftToAnon = ((pwalletMain->GetBalance() - pwalletMain->GetAnonymizedBalance())/COIN)-3; - if(nLeftToAnon > 999) nLeftToAnon = 999; - nAnonymizeDarkcoinAmount = (rand() % nLeftToAnon)+3; - } else { - darkSendPool.DoAutomaticDenominating(); - } - } else { - darkSendPool.DoAutomaticDenominating(); - } + if(darkSendPool.GetState() == POOL_STATUS_IDLE && c % 6 == 0){ + darkSendPool.DoAutomaticDenominating(); } } } diff --git a/src/darksend.h b/src/darksend.h index 753c90a6c..93c2bb789 100644 --- a/src/darksend.h +++ b/src/darksend.h @@ -39,8 +39,8 @@ class CActiveMasternode; #define MASTERNODE_REJECTED 0 #define MASTERNODE_RESET -1 -#define DARKSEND_QUEUE_TIMEOUT 120 -#define DARKSEND_SIGNING_TIMEOUT 30 +#define DARKSEND_QUEUE_TIMEOUT 30 +#define DARKSEND_SIGNING_TIMEOUT 15 // used for anonymous relaying of inputs/outputs/sigs #define DARKSEND_RELAY_IN 1 @@ -72,6 +72,7 @@ public: prevPubKey = in.prevPubKey; nSequence = in.nSequence; nSentTimes = 0; + fHasSig = false; } }; @@ -129,7 +130,22 @@ public: return true; } - /// Is this Darksend expired? + bool AddSig(const CTxIn& vin) + { + BOOST_FOREACH(CTxDSIn& s, sev) { + if(s.prevout == vin.prevout && s.nSequence == vin.nSequence){ + if(s.fHasSig){return false;} + s.scriptSig = vin.scriptSig; + s.prevPubKey = vin.prevPubKey; + s.fHasSig = true; + + return true; + } + } + + return false; + } + bool IsExpired() { return (GetTime() - addedTime) > DARKSEND_QUEUE_TIMEOUT;// 120 seconds From 42e056c5c5c7520ae97a8536f5caa53b8d2ffc88 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Mon, 6 Apr 2015 13:41:08 -0700 Subject: [PATCH 04/23] version/proto bump --- configure.ac | 2 +- src/clientversion.h | 2 +- src/core.h | 2 +- src/masternode-pos.h | 2 +- src/version.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index dbd795903..6e5a3b261 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 0) define(_CLIENT_VERSION_MINOR, 11) define(_CLIENT_VERSION_REVISION, 2) -define(_CLIENT_VERSION_BUILD, 17) +define(_CLIENT_VERSION_BUILD, 18) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2015) AC_INIT([Dash Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@dashpay.io],[dash]) diff --git a/src/clientversion.h b/src/clientversion.h index f8c4726f8..d247a32e4 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -12,7 +12,7 @@ #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 11 #define CLIENT_VERSION_REVISION 2 -#define CLIENT_VERSION_BUILD 17 +#define CLIENT_VERSION_BUILD 18 diff --git a/src/core.h b/src/core.h index 08799de00..e086a7dd9 100644 --- a/src/core.h +++ b/src/core.h @@ -43,7 +43,7 @@ static const int64_t DARKSEND_POOL_MAX = (999.99*COIN); #define MASTERNODE_EXPIRATION_SECONDS (65*60) #define MASTERNODE_REMOVAL_SECONDS (70*60) -static const int MIN_POOL_PEER_PROTO_VERSION = 70075; // minimum peer version accepted by DarkSendPool +static const int MIN_POOL_PEER_PROTO_VERSION = 70076; // minimum peer version accepted by DarkSendPool class CTransaction; diff --git a/src/masternode-pos.h b/src/masternode-pos.h index 0c08ed977..c9e2b8b60 100644 --- a/src/masternode-pos.h +++ b/src/masternode-pos.h @@ -25,7 +25,7 @@ class CMasternodeScanningError; extern map mapMasternodeScanningErrors; extern CMasternodeScanning mnscan; -static const int MIN_MASTERNODE_POS_PROTO_VERSION = 70075; +static const int MIN_MASTERNODE_POS_PROTO_VERSION = 70076; /* 1% of the network is scanned every 2.5 minutes, making a full diff --git a/src/version.h b/src/version.h index 68a9e05c2..1ad2e1b95 100644 --- a/src/version.h +++ b/src/version.h @@ -27,7 +27,7 @@ extern const std::string CLIENT_DATE; // network protocol versioning // -static const int PROTOCOL_VERSION = 70075; +static const int PROTOCOL_VERSION = 70076; // intial proto version, to be increased after version/verack negotiation static const int INIT_PROTO_VERSION = 209; From 7e72c2bccfeb18c4016aaa247bc6b584010fa8e3 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Mon, 6 Apr 2015 16:07:25 -0700 Subject: [PATCH 05/23] added nDenom check for dsa --- src/darksend.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/darksend.cpp b/src/darksend.cpp index 7335e3f5d..4ca883ce9 100644 --- a/src/darksend.cpp +++ b/src/darksend.cpp @@ -1819,6 +1819,8 @@ bool CDarksendPool::IsCompatibleWithEntries(std::vector& vout) bool CDarksendPool::IsCompatibleWithSession(int64_t nDenom, CTransaction txCollateral, std::string& strReason) { + if(nDenom == 0) return false; + LogPrintf("CDarksendPool::IsCompatibleWithSession - sessionDenom %d sessionUsers %d\n", sessionDenom, sessionUsers); if (!unitTest && !IsCollateralValid(txCollateral)){ From 649434dd2e2b3a44cb079fb1ce2cfbd573da60b3 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Tue, 7 Apr 2015 04:45:30 +0300 Subject: [PATCH 06/23] Fix SelectCoinsByDenominations relative things: - AvailableCoins inside SelectCoinsByDenominations should select denoms only now (also removing corresponding "if"s) - use temporary vectors in doauto when call SelectCoinsByDenominations to prevent vCoins modification - variables naming (set...->v...) --- src/darksend.cpp | 5 +++-- src/wallet.cpp | 20 +++++++++----------- src/wallet.h | 2 +- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/darksend.cpp b/src/darksend.cpp index 4ca883ce9..bfbe72a39 100644 --- a/src/darksend.cpp +++ b/src/darksend.cpp @@ -1416,7 +1416,6 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready) // ** find the coins we'll use std::vector vCoins; - std::vector vCoins2; int64_t nValueMin = CENT; int64_t nValueIn = 0; @@ -1518,8 +1517,10 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready) } } + std::vector vTempCoins; + std::vector vTempCoins2; // Try to match their denominations if possible - if (!pwalletMain->SelectCoinsByDenominations(dsq.nDenom, nValueMin, nBalanceNeedsAnonymized, vCoins, vCoins2, nValueIn, 0, nDarksendRounds)){ + if (!pwalletMain->SelectCoinsByDenominations(dsq.nDenom, nValueMin, nBalanceNeedsAnonymized, vTempCoins, vTempCoins2, nValueIn, 0, nDarksendRounds)){ LogPrintf("DoAutomaticDenominating - Couldn't match denominations %d\n", dsq.nDenom); continue; } diff --git a/src/wallet.cpp b/src/wallet.cpp index b30d3d7cb..15bd7c056 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1538,16 +1538,15 @@ struct CompareByPriority } }; -bool CWallet::SelectCoinsByDenominations(int nDenom, int64_t nValueMin, int64_t nValueMax, std::vector& setCoinsRet, vector& setCoinsRet2, int64_t& nValueRet, int nDarksendRoundsMin, int nDarksendRoundsMax) +bool CWallet::SelectCoinsByDenominations(int nDenom, int64_t nValueMin, int64_t nValueMax, std::vector& vCoinsRet, std::vector& vCoinsRet2, int64_t& nValueRet, int nDarksendRoundsMin, int nDarksendRoundsMax) { - setCoinsRet.clear(); + vCoinsRet.clear(); nValueRet = 0; - setCoinsRet2.clear(); + vCoinsRet2.clear(); vector vCoins; - AvailableCoins(vCoins); + AvailableCoins(vCoins, true, NULL, ONLY_DENOMINATED); - //order the array so fees are first, then denominated money, then the rest. std::random_shuffle(vCoins.rbegin(), vCoins.rend()); //keep track of each denomination that we have @@ -1564,9 +1563,8 @@ bool CWallet::SelectCoinsByDenominations(int nDenom, int64_t nValueMin, int64_t BOOST_FOREACH(const COutput& out, vCoins) { - //there's no reason to allow inputs less than 1 COIN into DS (other than denominations smaller than that amount) - if(out.tx->vout[out.i].nValue < 1*COIN && out.tx->vout[out.i].nValue != (.1*COIN)+100) continue; - if(fMasterNode && out.tx->vout[out.i].nValue == 1000*COIN) continue; //masternode input + // masternode-like input should not be selected by AvailableCoins now anyway + //if(out.tx->vout[out.i].nValue == 1000*COIN) continue; if(nValueRet + out.tx->vout[out.i].nValue <= nValueMax){ bool fAccepted = false; @@ -1590,7 +1588,7 @@ bool CWallet::SelectCoinsByDenominations(int nDenom, int64_t nValueMin, int64_t nValueMax -= (rand() % (nValueMax/5)); //on average use 50% of the inputs or less int r = (rand() % (int)vCoins.size()); - if((int)setCoinsRet.size() > r) return true; + if((int)vCoinsRet.size() > r) return true; } //Denomination criterion has been met, we can take any matching denominations if((nDenom & (1 << 0)) && out.tx->vout[out.i].nValue == ((100*COIN) +100000)) {fAccepted = true;} @@ -1608,8 +1606,8 @@ bool CWallet::SelectCoinsByDenominations(int nDenom, int64_t nValueMin, int64_t vin.prevPubKey = out.tx->vout[out.i].scriptPubKey; // the inputs PubKey nValueRet += out.tx->vout[out.i].nValue; - setCoinsRet.push_back(vin); - setCoinsRet2.push_back(out); + vCoinsRet.push_back(vin); + vCoinsRet2.push_back(out); } } diff --git a/src/wallet.h b/src/wallet.h index 30420e268..c896e7efa 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -134,7 +134,7 @@ private: public: bool SelectCoins(int64_t nTargetValue, std::set >& setCoinsRet, int64_t& nValueRet, const CCoinControl *coinControl = NULL, AvailableCoinsType coin_type=ALL_COINS, bool useIX = true) const; bool SelectCoinsDark(int64_t nValueMin, int64_t nValueMax, std::vector& setCoinsRet, int64_t& nValueRet, int nDarksendRoundsMin, int nDarksendRoundsMax) const; - bool SelectCoinsByDenominations(int nDenom, int64_t nValueMin, int64_t nValueMax, std::vector& setCoinsRet, vector& vCoins, int64_t& nValueRet, int nDarksendRoundsMin, int nDarksendRoundsMax); + bool SelectCoinsByDenominations(int nDenom, int64_t nValueMin, int64_t nValueMax, std::vector& vCoinsRet, std::vector& vCoinsRet2, int64_t& nValueRet, int nDarksendRoundsMin, int nDarksendRoundsMax); bool SelectCoinsDarkDenominated(int64_t nTargetValue, std::vector& setCoinsRet, int64_t& nValueRet) const; bool HasCollateralInputs() const; bool IsCollateralAmount(int64_t nInputAmount) const; From debcbb75b1d118041a6428dd12351fffd38a7076 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Tue, 7 Apr 2015 18:17:50 +0300 Subject: [PATCH 07/23] do not search for known sporks by hash, search only by ID --- src/spork.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spork.cpp b/src/spork.cpp index c9cd6b929..c80c22530 100644 --- a/src/spork.cpp +++ b/src/spork.cpp @@ -39,7 +39,7 @@ void ProcessSpork(CNode* pfrom, std::string& strCommand, CDataStream& vRecv) if(chainActive.Tip() == NULL) return; uint256 hash = spork.GetHash(); - if(mapSporks.count(hash) && mapSporksActive.count(spork.nSporkID)) { + if(mapSporksActive.count(spork.nSporkID)) { if(mapSporksActive[spork.nSporkID].nTimeSigned >= spork.nTimeSigned){ if(fDebug) LogPrintf("spork - seen %s block %d \n", hash.ToString().c_str(), chainActive.Tip()->nHeight); return; @@ -230,4 +230,4 @@ std::string CSporkManager::GetSporkNameByID(int id) if(id == SPORK_7_MASTERNODE_SCANNING) return "SPORK_7_MASTERNODE_SCANNING"; return "Unknown"; -} \ No newline at end of file +} From 0b225546f706885056d0b592678bec7f229fadac Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Tue, 7 Apr 2015 09:41:31 -0700 Subject: [PATCH 08/23] check collateral before submitting --- src/darksend.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/darksend.cpp b/src/darksend.cpp index bfbe72a39..91c9e06ca 100644 --- a/src/darksend.cpp +++ b/src/darksend.cpp @@ -1492,6 +1492,14 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready) return false; } + //check our collateral + if(txCollateral != CTransaction()){ + if(!IsCollateralValid(txCollateral)) { + txCollateral = CTransaction(); + LogPrintf("DoAutomaticDenominating -- Invalid collateral, resetting.\n"); + } + } + //don't use the queues all of the time for mixing if(nUseQueue > 33){ From d120557b052198ca0638a486f7a4115f93b3bc03 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Tue, 7 Apr 2015 10:09:42 -0700 Subject: [PATCH 09/23] updated chinese translations --- src/qt/locale/dash_cmn.ts | 37 ++++---- src/qt/locale/dash_zh_HK.ts | 164 ++++++++++++++++++------------------ 2 files changed, 101 insertions(+), 100 deletions(-) diff --git a/src/qt/locale/dash_cmn.ts b/src/qt/locale/dash_cmn.ts index 763c8367d..78c8ff679 100644 --- a/src/qt/locale/dash_cmn.ts +++ b/src/qt/locale/dash_cmn.ts @@ -1634,7 +1634,8 @@ Address: %4 Language missing or translation incomplete? Help contributing translations here: https://www.transifex.com/projects/p/dash/ - + 缺少相关语言或翻译不完整? 请到这里协助翻译: +https://www.transifex.com/projects/p/dash/ @@ -2417,7 +2418,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Dash network. - + 附加在付款要求中的讯息,可以不填,打开要求内容时会显示。注意: 这个讯息不会随着付款送到达世币网路上。 @@ -4150,32 +4151,32 @@ for example: alertnotify=echo %%s | mail -s "Dash Alert" admin@foo.com Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - + 警告: -paytxfee 设定了很高的金额!这可是你交易付款所要付的手续费。 Warning: Please check that your computer's date and time are correct! If your clock is wrong Dash will not work properly. - + 警告: 请检查电脑日期和时间是否正确!达世币核心没办法在时钟不准的情况下正常运作。 Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - + 警告: 达世币网路对于区块链结的决定目前有分歧!看来有些矿工会有问题。 Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - + 警告: 我们和某些连线的节点对于区块链结的决定不同!你可能需要升级,或是需要等其它的节点升级。 Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - + 警告: 读取钱包档wallet.dat 时发生错误!所有的密钥都正确读取了,但是交易资料或位址簿资料可能会缺少或不正确。 Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - + 警告: 钱包档wallet.dat 损坏,但资料被拯救回来了!原来的wallet.dat 会改储存在%s, 档名是wallet.{timestamp}.bak. 如果余额或交易资料有误,你应该要用备份资料复原回来。 @@ -4187,7 +4188,7 @@ If the file does not exist, create it with owner-readable-only file permissions. You must specify a masternodeprivkey in the configuration. Please see documentation for help. - + 您必须在配置中指定一个主节点密钥。请参阅文档以获得帮助。 @@ -4367,7 +4368,7 @@ If the file does not exist, create it with owner-readable-only file permissions. Do you want to rebuild the block database now? - + 你想要现在重建区块资料库吗? @@ -4392,7 +4393,7 @@ If the file does not exist, create it with owner-readable-only file permissions. Error connecting to masternode. - + 连接到主节点时发生错误。 @@ -4437,7 +4438,7 @@ If the file does not exist, create it with owner-readable-only file permissions. Error recovering public key. - + 恢复公钥时发生错误。 @@ -4567,7 +4568,7 @@ If the file does not exist, create it with owner-readable-only file permissions. Imports blocks from external blk000??.dat file - + 从其它来源的 blk000??.dat 档汇入区块 @@ -4897,7 +4898,7 @@ If the file does not exist, create it with owner-readable-only file permissions. Run a thread to flush wallet periodically (default: 1) - + 启用定期将变动写入​​钱包档的执行绪(默认: 1) @@ -4977,12 +4978,12 @@ If the file does not exist, create it with owner-readable-only file permissions. Set the number of threads to service RPC calls (default: 4) - + 设定处理RPC 服务请求的执行绪数目(默认: 4) Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - + 在钱包资料库环境变数设定DB_PRIVATE 旗标(默认: 1) @@ -5132,7 +5133,7 @@ If the file does not exist, create it with owner-readable-only file permissions. Unable to sign spork message, wrong key? - + 无法签署交叉信息,错误的密钥? @@ -5142,7 +5143,7 @@ If the file does not exist, create it with owner-readable-only file permissions. Unknown network specified in -onlynet: '%s' - + 在 -onlynet 指定了不明的网路别: '%s' diff --git a/src/qt/locale/dash_zh_HK.ts b/src/qt/locale/dash_zh_HK.ts index 5e5bb4a28..90e0660e7 100644 --- a/src/qt/locale/dash_zh_HK.ts +++ b/src/qt/locale/dash_zh_HK.ts @@ -4,19 +4,19 @@ About Dash Core - 關於暗黑幣核心 + 關於達世幣核心 <b>Dash Core</b> version - <b>暗黑幣核心</b> 版本 + <b>達世幣核心</b> 版本 Copyright &copy; 2009-2014 The Bitcoin Core developers. Copyright &copy; 2014-YYYY The Dash Core developers. 版權 &copy 為位元幣核心開發人員自西元 2009-2014年所有 -版權 &copy 為暗黑幣核心開發人員自西元 2014-YYYY年所有 +版權 &copy 為達世幣核心開發人員自西元 2014-YYYY年所有 @@ -49,7 +49,7 @@ This product includes software developed by the OpenSSL Project for use in the O The Dash Core developers - 暗黑幣核心開發人員 + 達世幣核心開發人員 @@ -138,12 +138,12 @@ This product includes software developed by the OpenSSL Project for use in the O These are your Dash addresses for sending payments. Always check the amount and the receiving address before sending coins. - 這些是你要付款過去的暗黑幣位址。在付款之前,務必要檢查金額和收款位址是否正確。 + 這些是你要付款過去的達世幣位址。在付款之前,務必要檢查金額和收款位址是否正確。 These are your Dash addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - 這些是你用來收款的暗黑幣位址。建議在每次交易時,都使用一個新的收款位址。 + 這些是你用來收款的達世幣位址。建議在每次交易時,都使用一個新的收款位址。 @@ -278,8 +278,8 @@ This product includes software developed by the OpenSSL Project for use in the O - Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR DARKCOINS</b>! - 警告:如果把錢包加密後又忘記密碼,你就會從此<b>失去所有的暗黑幣了</b>! + Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR DASH</b>! + 警告:如果把錢包加密後又忘記密碼,你就會從此<b>失去所有的達世幣了</b>! @@ -295,7 +295,7 @@ This product includes software developed by the OpenSSL Project for use in the O Dash will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your dashs from being stolen by malware infecting your computer. - 暗黑幣軟體現在要關閉,以完成加密過程。請注意,加密錢包不能完全防止惡意軟件入侵你的電腦盜取你的暗黑幣。 + 達世幣軟體現在要關閉,以完成加密過程。請注意,加密錢包不能完全防止惡意軟件入侵你的電腦盜取你的達世幣。 @@ -355,7 +355,7 @@ This product includes software developed by the OpenSSL Project for use in the O Dash Core - 暗黑幣核心 + 達世幣核心 @@ -391,7 +391,7 @@ This product includes software developed by the OpenSSL Project for use in the O Send coins to a Dash address - 發送幣至暗黑幣地址 + 發送幣至達世幣地址 @@ -401,7 +401,7 @@ This product includes software developed by the OpenSSL Project for use in the O Request payments (generates QR codes and dash: URIs) - 要求付款(生成二維碼和暗黑幣付款協議的 URI) + 要求付款(生成二維碼和達世幣付款協議的 URI) @@ -427,12 +427,12 @@ This product includes software developed by the OpenSSL Project for use in the O &About Dash Core - 關於暗黑幣核心 + 關於達世幣核心 Show information about Dash - 顯示暗黑幣的相關資訊 + 顯示達世幣的相關資訊 @@ -453,7 +453,7 @@ This product includes software developed by the OpenSSL Project for use in the O Modify configuration options for Dash - 修改暗黑幣配置選項 + 修改達世幣配置選項 @@ -519,7 +519,7 @@ This product includes software developed by the OpenSSL Project for use in the O Sign messages with your Dash addresses to prove you own them - 用暗黑幣位址簽署訊息來證明位址是你的 + 用達世幣位址簽署訊息來證明位址是你的 @@ -529,7 +529,7 @@ This product includes software developed by the OpenSSL Project for use in the O Verify messages to ensure they were signed with specified Dash addresses - 驗證訊息是用來確定訊息是用指定的暗黑幣位址簽署的 + 驗證訊息是用來確定訊息是用指定的達世幣位址簽署的 @@ -599,7 +599,7 @@ This product includes software developed by the OpenSSL Project for use in the O Open a dash: URI or payment request - 打開暗黑幣:網頁或付款請求 + 打開達世幣:網頁或付款請求 @@ -609,7 +609,7 @@ This product includes software developed by the OpenSSL Project for use in the O Show the Dash Core help message to get a list with possible Dash command-line options - 打開暗黑幣核心的幫助信息以取得可使用的命令行列表 + 打開達世幣核心的幫助信息以取得可使用的命令行列表 @@ -640,12 +640,12 @@ This product includes software developed by the OpenSSL Project for use in the O Dash client - 暗黑幣客戶端 + 達世幣客戶端 %n active connection(s) to Dash network - %n 個運作中的暗黑幣網路連線 + %n 個運作中的達世幣網路連線 @@ -726,7 +726,7 @@ This product includes software developed by the OpenSSL Project for use in the O Dash - 暗黑幣 + 達世幣 @@ -784,7 +784,7 @@ Address: %4 A fatal error occurred. Dash can no longer continue safely and will quit. - 發生嚴重錯誤。暗黑幣不能繼續安全操作,將退出。 + 發生嚴重錯誤。達世幣不能繼續安全操作,將退出。 @@ -1181,17 +1181,17 @@ Address: %4 Darksend was successfully set to basic (%1 and 2 rounds). You can change this at any time by opening Dash's configuration screen. - 匿名發送已成功設置為一般(%1到2次循環)。你可以通過打開暗黑幣配置窗口來隨時修改。 + 匿名發送已成功設置為一般(%1到2次循環)。你可以通過打開達世幣配置窗口來隨時修改。 Darksend was successfully set to high (%1 and 8 rounds). You can change this at any time by opening Dash's configuration screen. - 匿名發送已成功設置為高(%1到8次循環)。你可以通過打開暗黑幣配置窗口來隨時修改。 + 匿名發送已成功設置為高(%1到8次循環)。你可以通過打開達世幣配置窗口來隨時修改。 Darksend was successfully set to maximum (%1 and 16 rounds). You can change this at any time by opening Dash's configuration screen. - 匿名發送已成功設置為最高(%1到16次循環)。你可以通過打開暗黑幣配置窗口來隨時修改。 + 匿名發送已成功設置為最高(%1到16次循環)。你可以通過打開達世幣配置窗口來隨時修改。 @@ -1244,7 +1244,7 @@ Address: %4 The entered address "%1" is not a valid Dash address. - 輸入的地址"%1"不是有效的暗黑幣地址。 + 輸入的地址"%1"不是有效的達世幣地址。 @@ -1295,12 +1295,12 @@ Address: %4 Dash Core - Command-line options - 暗黑幣核心 - 命令行選項 + 達世幣核心 - 命令行選項 Dash Core - 暗黑幣核心 + 達世幣核心 @@ -1358,17 +1358,17 @@ Address: %4 Welcome to Dash Core. - 歡迎來到暗黑幣核心。 + 歡迎來到達世幣核心。 As this is the first time the program is launched, you can choose where Dash Core will store its data. - 因為這是程式第一次啓動,你可以選擇暗黑幣核心儲存資料的地方。 + 因為這是程式第一次啓動,你可以選擇達世幣核心儲存資料的地方。 Dash Core will download and store a copy of the Dash block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - 暗黑幣核心會下載並儲存一份暗黑幣區塊鏈的拷貝。至少有 %1GB 的資料會儲存到這個目錄中,並且還會持續增長。另外錢包資料也會儲存在這個目錄。 + 達世幣核心會下載並儲存一份達世幣區塊鏈的拷貝。至少有 %1GB 的資料會儲存到這個目錄中,並且還會持續增長。另外錢包資料也會儲存在這個目錄。 @@ -1383,7 +1383,7 @@ Address: %4 Dash - 暗黑幣 + 達世幣 @@ -1449,12 +1449,12 @@ Address: %4 Automatically start Dash after logging in to the system. - 登錄系統後自動啟動暗黑幣程序 + 登錄系統後自動啟動達世幣程序 &Start Dash on system login - 系統登錄時啟動暗黑幣程序 + 系統登錄時啟動達世幣程序 @@ -1494,7 +1494,7 @@ Address: %4 Amount of Dash to keep anonymized - 保持匿名化的暗黑幣數 + 保持匿名化的達世幣數 @@ -1544,7 +1544,7 @@ Address: %4 Automatically open the Dash client port on the router. This only works when your router supports UPnP and it is enabled. - 自動對路由器打開暗黑幣客戶端端口。此項只在路由器支持UPnP時有效。 + 自動對路由器打開達世幣客戶端端口。此項只在路由器支持UPnP時有效。 @@ -1554,7 +1554,7 @@ Address: %4 Connect to the Dash network through a SOCKS proxy. - 通過SOCKS代理鏈接暗黑幣網絡。 + 通過SOCKS代理鏈接達世幣網絡。 @@ -1629,7 +1629,7 @@ Address: %4 The user interface language can be set here. This setting will take effect after restarting Dash. - 可以在這裡設定使用者介面的語言。這個設定在重啓暗黑幣軟體後才會生效。 + 可以在這裡設定使用者介面的語言。這個設定在重啓達世幣軟體後才會生效。 @@ -1651,7 +1651,7 @@ https://www.transifex.com/projects/p/dash/ Whether to show Dash addresses in the transaction list or not. - 是否顯示交易列表中的暗黑幣地址。 + 是否顯示交易列表中的達世幣地址。 @@ -1748,7 +1748,7 @@ https://www.transifex.com/projects/p/dash/ The displayed information may be out of date. Your wallet automatically synchronizes with the Dash network after a connection is established, but this process has not completed yet. - 顯示的資訊可能是過期的。跟暗黑幣網路的連線建立後,你的錢包會自動和網路同步,但是這個步驟還沒完成。 + 顯示的資訊可能是過期的。跟達世幣網路的連線建立後,你的錢包會自動和網路同步,但是這個步驟還沒完成。 @@ -1813,7 +1813,7 @@ https://www.transifex.com/projects/p/dash/ 0 DASH - 0 暗黑幣 + 0 達世幣 @@ -1823,7 +1823,7 @@ https://www.transifex.com/projects/p/dash/ 0 DASH / 0 Rounds - 0 暗黑幣 / 0 循環數 + 0 達世幣 / 0 循環數 @@ -1945,7 +1945,7 @@ https://www.transifex.com/projects/p/dash/ Mixing in progress... - + 正在進行混合... @@ -2065,7 +2065,7 @@ https://www.transifex.com/projects/p/dash/ Cannot start dash: click-to-pay handler - 無法啟動暗黑幣程序:click-to-pay handler + 無法啟動達世幣程序:click-to-pay handler @@ -2091,7 +2091,7 @@ https://www.transifex.com/projects/p/dash/ URI can not be parsed! This can be caused by an invalid Dash address or malformed URI parameters. - 鏈接無法被解析! 原因可能是無效的暗黑幣地址或輸入的鏈接有錯。 + 鏈接無法被解析! 原因可能是無效的達世幣地址或輸入的鏈接有錯。 @@ -2152,7 +2152,7 @@ https://www.transifex.com/projects/p/dash/ Dash - 暗黑幣 + 達世幣 @@ -2177,12 +2177,12 @@ https://www.transifex.com/projects/p/dash/ Dash Core didn't yet exit safely... - 暗黑幣核心還未安全退出... + 達世幣核心還未安全退出... Enter a Dash address (e.g. XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) - 输入暗黑币地址(如. + 输入達世幣地址(如. XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) @@ -2355,7 +2355,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) Welcome to the Dash RPC console. - 歡迎來到暗黑幣RPC控制台。 + 歡迎來到達世幣RPC控制台。 @@ -2419,7 +2419,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Dash network. - 附加在付款要求中的訊息,可以不填,打開要求內容時會顯示。注意: 這個訊息不會隨著付款送到暗黑幣網路上。 + 附加在付款要求中的訊息,可以不填,打開要求內容時會顯示。注意: 這個訊息不會隨著付款送到達世幣網路上。 @@ -2904,7 +2904,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) Warning: Invalid Dash address - 警告:無效的暗黑幣地址 + 警告:無效的達世幣地址 @@ -2986,7 +2986,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) A message that was attached to the dash: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Dash network. - 附加在暗黑幣付款協議 URI 中的訊息,會和交易內容一起存起來,給你自己做參考。注意: 這個訊息不會送到暗黑幣網路上。 + 附加在達世幣付款協議 URI 中的訊息,會和交易內容一起存起來,給你自己做參考。注意: 這個訊息不會送到達世幣網路上。 @@ -3021,7 +3021,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) Dash Core is shutting down... - 暗黑幣核心正在關閉... + 達世幣核心正在關閉... @@ -3091,7 +3091,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) Sign the message to prove you own this Dash address - 簽署信息證明你擁有此暗黑幣地址 + 簽署信息證明你擁有此達世幣地址 @@ -3127,7 +3127,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) Verify the message to ensure it was signed with the specified Dash address - 驗證信息用來確保此被簽署信息對應相對的暗黑幣地址 + 驗證信息用來確保此被簽署信息對應相對的達世幣地址 @@ -3147,7 +3147,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) Enter a Dash address (e.g. XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) - 輸入暗黑幣地址(如. + 輸入達世幣地址(如. XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) @@ -3222,7 +3222,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) Dash Core - 暗黑幣核心 + 達世幣核心 @@ -3237,7 +3237,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) The Dash Core developers - 暗黑幣核心開發人員 + 達世幣核心開發人員 @@ -3620,7 +3620,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) Darksent - 暗黑發送 + 匿名發送 @@ -3704,7 +3704,7 @@ XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) Darksent - 暗黑發送 + 匿名發送 @@ -3971,7 +3971,7 @@ rpcpassword=%s Cannot obtain a lock on data directory %s. Dash Core is probably already running. - 無法獲得鎖定的數據目錄%s. 暗黑幣核心可能已經在運行。 + 無法獲得鎖定的數據目錄%s. 達世幣核心可能已經在運行。 @@ -3981,7 +3981,7 @@ rpcpassword=%s Darksend uses exact denominated amounts to send funds, you might simply need to anonymize some more coins. - 暗黑發送要使用相同的除名金額用來發送資金,你可能需要對更多的幣進行匿名處理。 + 匿名發送要使用相同的除名金額用來發送資金,你可能需要對更多的幣進行匿名處理。 @@ -4096,7 +4096,7 @@ rpcpassword=%s Provide liquidity to Darksend by infrequently mixing coins on a continual basis (0-100, default: 0, 1=very frequent, high fees, 100=very infrequent, low fees) - 透過偶爾混合暗黑幣,並為暗黑發送持續提供流動性 (0-100,預設值 : 0 ,1=經常 ,收費高,100=不經常,收費低) + 透過偶爾混合達世幣,並為匿名發送持續提供流動性 (0-100,預設值 : 0 ,1=經常 ,收費高,100=不經常,收費低) @@ -4136,12 +4136,12 @@ rpcpassword=%s Unable to bind to %s on this computer. Dash Core is probably already running. - 沒辦法繫結在這台電腦上的 %s 。暗黑幣核心可能已經在執行了。 + 沒辦法繫結在這台電腦上的 %s 。達世幣核心可能已經在執行了。 Unable to locate enough Darksend denominated funds for this transaction. - 無法找到足夠的暗黑發送己除名資金用於本次交易。 + 無法找到足夠的匿名發送己除名資金用於本次交易。 @@ -4166,12 +4166,12 @@ rpcpassword=%s Warning: Please check that your computer's date and time are correct! If your clock is wrong Dash will not work properly. - 警告: 請檢查電腦日期和時間是否正確!暗黑幣核心沒辦法在時鐘不準的情況下正常運作。 + 警告: 請檢查電腦日期和時間是否正確!達世幣核心沒辦法在時鐘不準的情況下正常運作。 Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - 警告: 暗黑幣網路對於區塊鏈結的決定目前有分歧!看來有些礦工會有問題。 + 警告: 達世幣網路對於區塊鏈結的決定目前有分歧!看來有些礦工會有問題。 @@ -4340,22 +4340,22 @@ If the file does not exist, create it with owner-readable-only file permissions. Dash Core Daemon - 黑幣核心後台程序 + 達世幣核心後台程序 Dash Core RPC client version - 暗黑幣核心RPC客戶端版本 + 達世幣核心RPC客戶端版本 Darksend is disabled. - 暗黑發送已禁用。 + 匿名發送已禁用。 Darksend options: - 暗黑發送選項 : + 匿名發送選項 : @@ -4390,7 +4390,7 @@ If the file does not exist, create it with owner-readable-only file permissions. Downgrading and trying again. - + 正在降級並再次嘗試。 @@ -4435,7 +4435,7 @@ If the file does not exist, create it with owner-readable-only file permissions. Error loading wallet.dat: Wallet requires newer version of Dash - 載入檔案 wallet.dat 時發生錯誤: 錢包需要更新的暗黑幣版本 + 載入檔案 wallet.dat 時發生錯誤: 錢包需要更新的達世幣版本 @@ -4450,7 +4450,7 @@ If the file does not exist, create it with owner-readable-only file permissions. Error recovering public key. - 恢復公鑰時發生錯誤 + 恢復公鑰時發生錯誤。 @@ -4550,7 +4550,7 @@ If the file does not exist, create it with owner-readable-only file permissions. Generate coins (default: 0) - 生產暗黑幣 (預設值: 0) + 生產達世幣 (預設值: 0) @@ -4605,7 +4605,7 @@ If the file does not exist, create it with owner-readable-only file permissions. Initialization sanity check failed. Dash Core is shutting down. - 初始化時的基本檢查失敗了。暗黑幣核心將會關閉。 + 初始化時的基本檢查失敗了。達世幣核心將會關閉。 @@ -4685,7 +4685,7 @@ If the file does not exist, create it with owner-readable-only file permissions. Keep N dash anonymized (default: 0) - 保持 N 個暗黑幣是匿名的 (預設值 : 0) + 保持 N 個達世幣是匿名的 (預設值 : 0) @@ -4705,7 +4705,7 @@ If the file does not exist, create it with owner-readable-only file permissions. Last successful darksend action was too recent. - 距離上一次成功進行暗黑發送的時間太短。 + 距離上一次成功進行匿名發送的時間太短。 @@ -4735,7 +4735,7 @@ If the file does not exist, create it with owner-readable-only file permissions. Loading masternode list... - + 正在加載主節點清單... @@ -4930,7 +4930,7 @@ If the file does not exist, create it with owner-readable-only file permissions. Send command to Dash Core - 向暗黑幣核心發送命令 + 向達世幣核心發送命令 @@ -5070,7 +5070,7 @@ If the file does not exist, create it with owner-readable-only file permissions. Start Dash Core Daemon - 啟動暗黑幣核心後台程序 + 啟動達世幣核心後台程序 From 631e4b505f4d2e4d2ec5571667ac744b5ab48da2 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Tue, 7 Apr 2015 12:59:30 -0700 Subject: [PATCH 10/23] fixed vote-many --- configure.ac | 2 +- src/clientversion.h | 2 +- src/masternodeman.cpp | 14 ++++++++++++++ src/masternodeman.h | 1 + src/rpcdarksend.cpp | 39 +++++++++++++++++++++++++++++---------- 5 files changed, 46 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index 6e5a3b261..52eafbbb2 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 0) define(_CLIENT_VERSION_MINOR, 11) define(_CLIENT_VERSION_REVISION, 2) -define(_CLIENT_VERSION_BUILD, 18) +define(_CLIENT_VERSION_BUILD, 19) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2015) AC_INIT([Dash Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@dashpay.io],[dash]) diff --git a/src/clientversion.h b/src/clientversion.h index d247a32e4..f02234e53 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -12,7 +12,7 @@ #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 11 #define CLIENT_VERSION_REVISION 2 -#define CLIENT_VERSION_BUILD 18 +#define CLIENT_VERSION_BUILD 19 diff --git a/src/masternodeman.cpp b/src/masternodeman.cpp index bfb578836..afaed60a1 100644 --- a/src/masternodeman.cpp +++ b/src/masternodeman.cpp @@ -333,6 +333,20 @@ CMasternode *CMasternodeMan::Find(const CTxIn &vin) return NULL; } + +CMasternode *CMasternodeMan::Find(const CPubKey &pubKeyMasternode) +{ + LOCK(cs); + + BOOST_FOREACH(CMasternode& mn, vMasternodes) + { + if(mn.pubkey2 == pubKeyMasternode) + return &mn; + } + return NULL; +} + + CMasternode* CMasternodeMan::FindOldestNotInVec(const std::vector &vVins, int nMinimumAge, int nMinimumActiveSeconds) { LOCK(cs); diff --git a/src/masternodeman.h b/src/masternodeman.h index d4ba67609..31ad4cbb8 100644 --- a/src/masternodeman.h +++ b/src/masternodeman.h @@ -108,6 +108,7 @@ public: /// Find an entry CMasternode* Find(const CTxIn& vin); + CMasternode* Find(const CPubKey& pubKeyMasternode); /// Find an entry thta do not match every entry provided vector CMasternode* FindOldestNotInVec(const std::vector &vVins, int nMinimumAge, int nMinimumActiveSeconds); diff --git a/src/rpcdarksend.cpp b/src/rpcdarksend.cpp index ba9ec66ce..0dfd54da1 100644 --- a/src/rpcdarksend.cpp +++ b/src/rpcdarksend.cpp @@ -583,6 +583,9 @@ Value masternode(const Array& params, bool fHelp) if(vote == "nay") nVote = -1; + int success = 0; + int failed = 0; + Object resultObj; BOOST_FOREACH(CMasternodeConfig::CMasternodeEntry mne, masternodeConfig.getEntries()) { @@ -596,27 +599,43 @@ Value masternode(const Array& params, bool fHelp) CPubKey pubKeyMasternode; CKey keyMasternode; - if(!activeMasternode.GetMasterNodeVin(vin, pubKeyCollateralAddress, keyCollateralAddress, mne.getTxHash(), mne.getOutputIndex())) { - return("could not allocate vin"); + if(!darkSendSigner.SetKey(mne.getPrivKey(), errorMessage, keyMasternode, pubKeyMasternode)){ + printf(" Error upon calling SetKey for %s\n", mne.getAlias().c_str()); + failed++; + continue; + } + + CMasternode* pmn = mnodeman.Find(pubKeyMasternode); + if(pmn == NULL) + { + printf("Can't find masternode by pubkey for %s\n", mne.getAlias().c_str()); + failed++; + continue; } - std::string strMessage = vin.ToString() + boost::lexical_cast(nVote); + std::string strMessage = pmn->vin.ToString() + boost::lexical_cast(nVote); - if(!darkSendSigner.SetKey(mne.getPrivKey(), errorMessage, keyMasternode, pubKeyMasternode)) - return(" Error upon calling SetKey"); + if(!darkSendSigner.SignMessage(strMessage, errorMessage, vchMasterNodeSignature, keyMasternode)){ + printf(" Error upon calling SignMessage for %s\n", mne.getAlias().c_str()); + failed++; + continue; + } - if(!darkSendSigner.SignMessage(strMessage, errorMessage, vchMasterNodeSignature, keyMasternode)) - return(" Error upon calling SignMessage"); + if(!darkSendSigner.VerifyMessage(pubKeyMasternode, vchMasterNodeSignature, strMessage, errorMessage)){ + printf(" Error upon calling VerifyMessage for %s\n", mne.getAlias().c_str()); + failed++; + continue; + } - if(!darkSendSigner.VerifyMessage(pubKeyMasternode, vchMasterNodeSignature, strMessage, errorMessage)) - return(" Error upon calling VerifyMessage"); + success++; //send to all peers LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) pnode->PushMessage("mvote", vin, vchMasterNodeSignature, nVote); - } + + return("Voted successfully " + boost::lexical_cast(success) + " time(s) and failed " + boost::lexical_cast(failed) + " time(s)."); } if(strCommand == "vote") From 88ab84a2e70ab10814a2f34d5219329916a596cd Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Tue, 7 Apr 2015 17:35:22 -0700 Subject: [PATCH 11/23] updated translatios --- src/qt/locale/dash_es.ts | 2 +- src/qt/locale/dash_fi.ts | 23 +++++++++++------------ src/qt/locale/dash_sv.ts | 6 +++--- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/qt/locale/dash_es.ts b/src/qt/locale/dash_es.ts index 567ad6a28..508ffc689 100644 --- a/src/qt/locale/dash_es.ts +++ b/src/qt/locale/dash_es.ts @@ -4390,7 +4390,7 @@ Si el archivo no existe, créelo con permiso de lectura solamente del propietari Downgrading and trying again. - + Descargando e intentando de nuevo. diff --git a/src/qt/locale/dash_fi.ts b/src/qt/locale/dash_fi.ts index 598c1c418..325ca04f4 100644 --- a/src/qt/locale/dash_fi.ts +++ b/src/qt/locale/dash_fi.ts @@ -33,7 +33,7 @@ Levitetään MIT/X11 ohjelmistolisenssin alaisuudessa. Tarkemmat tiedot löytyv Tämä ohjelma sisältää OpenSSL projektin OpenSSL työkalupakin (http://www.openssl.org/), Eric Youngin (eay@cryptsoft.com) kehittämän salausohjelmiston sekä Thomas Bernardin UPnP ohjelmiston. -Käännös päivitetty: 29.3.2015 by AjM. +Käännös päivitetty: 7.4.2015 by AjM. @@ -279,8 +279,7 @@ Käännös päivitetty: 29.3.2015 by AjM. Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR DASH</b>! - Varoitus: Jos salaat lompakon ja unohdat salasanan, -<b>MENETÄT KAIKKI DASHISI</b>! + Varoitus: Jos salaat lompakon ja unohdat salasanan, <b>MENETÄT KAIKKI DASHisi</b>! @@ -296,7 +295,7 @@ Käännös päivitetty: 29.3.2015 by AjM. Dash will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your dashs from being stolen by malware infecting your computer. - Dash sulkeutuu nyt salauksen viimeistelyä varten. Muista että salaus pelkästään ei voi estää dashiesi varastamista jos koneesi saastuu haittaohjelmilla tai viruksilla. + Dash sulkeutuu nyt salauksen viimeistelyä varten. Muista että salaus pelkästään ei voi estää Dashiesi varastamista jos koneesi saastuu haittaohjelmilla tai viruksilla. @@ -1775,7 +1774,7 @@ https://www.transifex.com/projects/p/dash/ Immature: - Vahvistamatta: + Kypsymättä: @@ -1883,7 +1882,7 @@ https://www.transifex.com/projects/p/dash/ <b>Recent transactions</b> - <b>Viimeisimmät tapahtumat</b> + <b>Uusimmat tapahtumat</b> @@ -2067,7 +2066,7 @@ https://www.transifex.com/projects/p/dash/ Cannot start dash: click-to-pay handler - Ei voi käynnistää dashia: click-to-pay handler + Ei voi käynnistää Dashia: click-to-pay handler @@ -2987,7 +2986,7 @@ https://www.transifex.com/projects/p/dash/ A message that was attached to the dash: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Dash network. - Viesti joka liitettiin dash: URI joka talletetaan siirtotapahtuman kanssa viitteeksi sinulle. Huomio: Tätä viestiä ei lähetetä Dash verkkoon. + Viesti joka liitettiin Dash: URI joka talletetaan siirtotapahtuman kanssa viitteeksi sinulle. Huomio: Tätä viestiä ei lähetetä Dash verkkoon. @@ -3027,7 +3026,7 @@ https://www.transifex.com/projects/p/dash/ Do not shut down the computer until this window disappears. - Älä sammuta tietokonetta ennenkuin tämä ikkuna katoaa. + Älä sammuta tietokonetta ennen kuin tämä ikkuna katoaa. @@ -3540,7 +3539,7 @@ https://www.transifex.com/projects/p/dash/ Confirming (%1 of %2 recommended confirmations) - Vahvistetaan (%1 kehoitetusta %2 vahvistuksesta) + Vahvistetaan (%1 / %2 vahvistusta) @@ -4436,7 +4435,7 @@ Jos tiedostoa ei ole, niin luo se ainoastaan omistajan kirjoitusoikeuksin. Error loading wallet.dat: Wallet requires newer version of Dash - Virhe ladattaessa wallet.dat lompakkotiedostoa: Tarvitset uudemman version dashista + Virhe ladattaessa wallet.dat lompakkotiedostoa: Tarvitset uudemman version Dashista @@ -4686,7 +4685,7 @@ Jos tiedostoa ei ole, niin luo se ainoastaan omistajan kirjoitusoikeuksin. Keep N dash anonymized (default: 0) - Pidä N dashia anonymisoituna (default: 0) + Pidä N Dashia anonymisoituna (default: 0) diff --git a/src/qt/locale/dash_sv.ts b/src/qt/locale/dash_sv.ts index 520075c4c..5f7c1bfc1 100644 --- a/src/qt/locale/dash_sv.ts +++ b/src/qt/locale/dash_sv.ts @@ -16,7 +16,7 @@ Copyright &copy; 2009-2014 The Bitcoin Core developers. Copyright &copy; 2014-YYYY The Dash Core developers. Upphovsrätt &kopia: 2009 - 2015 Bitcoin Core-utvecklarna. -Upphovsrätt &kopia; 2014 - YYYY Dash Core, utvecklarna. +Upphovsrätt &kopia; 2014 - YYYY Dash Core-utvecklarna. @@ -4405,7 +4405,7 @@ Om filen inte existerar, skapa den och ge inga andra än ägaren läsarrättighe - Error connecting to Masternode. + Error connecting to masternode. Fel vid anslutning till masternode. @@ -4736,7 +4736,7 @@ Om filen inte existerar, skapa den och ge inga andra än ägaren läsarrättighe Loading masternode list... - + Laddar masternode-listan. From f358a8a6988da7ee63827dba6444c04ec3fc54de Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Wed, 8 Apr 2015 03:43:40 +0300 Subject: [PATCH 12/23] fix filtering for masternode list votes rpc --- src/rpcdarksend.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpcdarksend.cpp b/src/rpcdarksend.cpp index 0dfd54da1..1faefd5ac 100644 --- a/src/rpcdarksend.cpp +++ b/src/rpcdarksend.cpp @@ -804,7 +804,7 @@ Value masternodelist(const Array& params, bool fHelp) if(mn.nVote == 1) strStatus = "YEA"; } - if(strFilter !="" && (strAddr.find(strFilter) == string::npos || strStatus.find(strFilter) == string::npos)) continue; + if(strFilter !="" && (strAddr.find(strFilter) == string::npos && strStatus.find(strFilter) == string::npos)) continue; obj.push_back(Pair(strAddr, strStatus.c_str())); } } From 5c03872655ece67ede2efea2a0b5bdeb8a93a9e8 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Tue, 7 Apr 2015 17:45:33 -0700 Subject: [PATCH 13/23] fixed vote crashes --- src/rpcdarksend.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/rpcdarksend.cpp b/src/rpcdarksend.cpp index 0dfd54da1..3fd79a1a2 100644 --- a/src/rpcdarksend.cpp +++ b/src/rpcdarksend.cpp @@ -576,6 +576,9 @@ Value masternode(const Array& params, bool fHelp) std::vector mnEntries; mnEntries = masternodeConfig.getEntries(); + if (params.size() != 2) + throw runtime_error("You can only vote 'yea' or 'nay'"); + std::string vote = params[1].get_str().c_str(); if(vote != "yea" && vote != "nay") return "You can only vote 'yea' or 'nay'"; int nVote = 0; @@ -643,6 +646,9 @@ Value masternode(const Array& params, bool fHelp) std::vector mnEntries; mnEntries = masternodeConfig.getEntries(); + if (params.size() != 2) + throw runtime_error("You can only vote 'yea' or 'nay'"); + std::string vote = params[1].get_str().c_str(); if(vote != "yea" && vote != "nay") return "You can only vote 'yea' or 'nay'"; int nVote = 0; From ec80b252177a7b6413dd882210129abb7da16ebc Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Tue, 7 Apr 2015 20:05:40 -0700 Subject: [PATCH 14/23] updated chinese translations --- src/qt/locale/dash_zh_CN.ts | 586 ++++++++++++++++++------------------ 1 file changed, 295 insertions(+), 291 deletions(-) diff --git a/src/qt/locale/dash_zh_CN.ts b/src/qt/locale/dash_zh_CN.ts index 51eabf177..60cd530d4 100644 --- a/src/qt/locale/dash_zh_CN.ts +++ b/src/qt/locale/dash_zh_CN.ts @@ -4,18 +4,19 @@ About Dash Core - 关于 Dash Core + 关于 达世币核心 <b>Dash Core</b> version - <b>Dash Core</b> 版本 + <b>达世币核心</b> 版本 Copyright &copy; 2009-2014 The Bitcoin Core developers. Copyright &copy; 2014-YYYY The Dash Core developers. - + 版权 &copy; 2009-2014 比特币核心的开发者。 +版权 &copy; 达世币核心的开发者。 @@ -46,7 +47,7 @@ This product includes software developed by the OpenSSL Project for use in the O The Dash Core developers - Dash Core 的开发者 + 达世币核心开发人员 @@ -135,12 +136,12 @@ This product includes software developed by the OpenSSL Project for use in the O These are your Dash addresses for sending payments. Always check the amount and the receiving address before sending coins. - 这些是您用以发送暗黑币的地址。请务必在每次发送前检查金额及接收地址。 + 这些是你要付款过去的达世币地址。在付款之前,务必要检查金额和收款地址是否正确。 These are your Dash addresses for receiving payments. It is recommended to use a new receiving address for each transaction. - 这些是您用以接收暗黑币的地址。推荐使用新地址以接收每次的转账。 + 这些是你用来收款的达世币地址。建议在每次交易时,都使用一个新的收款地址。 @@ -221,7 +222,7 @@ This product includes software developed by the OpenSSL Project for use in the O Serves to disable the trivial sendmoney when OS account compromised. Provides no real security. - + 当OS帐号被盗就禁止发送币。这并不提供真正的安全性。 @@ -276,7 +277,7 @@ This product includes software developed by the OpenSSL Project for use in the O Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR DASH</b>! - 警告:如果您加密了钱包却将该密码遗忘,您将<b>丢失您的暗黑币</b> + 警告:如果把钱包加​​密后又忘记密码,你就会从此<b>失去所有的达世币了</b>! @@ -292,7 +293,7 @@ This product includes software developed by the OpenSSL Project for use in the O Dash will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your dashs from being stolen by malware infecting your computer. - 暗黑币即将关闭以完成加密。请牢记即便是加密后的钱包也无法完全保护您的暗黑币免遭被恶意程序入侵等被偷之患。 + 达世币软体现在要关闭,以完成加密过程。请注意,加密钱包不能完全防止恶意软件入侵你的电脑盗取你的达世币。 @@ -352,7 +353,7 @@ This product includes software developed by the OpenSSL Project for use in the O Dash Core - 暗黑币 内核 + 达世币核心 @@ -388,7 +389,7 @@ This product includes software developed by the OpenSSL Project for use in the O Send coins to a Dash address - 向暗黑币地址发送 + 发送币至达世币地址 @@ -398,7 +399,7 @@ This product includes software developed by the OpenSSL Project for use in the O Request payments (generates QR codes and dash: URIs) - 请求付款(产生QR码以及暗黑币:URIs) + 请求付款(生成二维码和达世币付款协议的URI) @@ -424,12 +425,12 @@ This product includes software developed by the OpenSSL Project for use in the O &About Dash Core - 关于暗黑币内核(&A) + &关于达世币核心 Show information about Dash - 显示关于暗黑币的信息 + 显示达世币的相关资讯 @@ -450,7 +451,7 @@ This product includes software developed by the OpenSSL Project for use in the O Modify configuration options for Dash - 更改暗黑币设置 + 修改达世币配置选项 @@ -516,7 +517,7 @@ This product includes software developed by the OpenSSL Project for use in the O Sign messages with your Dash addresses to prove you own them - 使用您的暗黑币地址进行消息签名以证明对此地址的所有权 + 用达世币地址签署讯息来证明地址是你的 @@ -526,7 +527,7 @@ This product includes software developed by the OpenSSL Project for use in the O Verify messages to ensure they were signed with specified Dash addresses - 校验消息签名以证明此消息是由特定暗黑币地址所签发 + 验证讯息是用来确定讯息是用指定的达世币地址签署的 @@ -596,7 +597,7 @@ This product includes software developed by the OpenSSL Project for use in the O Open a dash: URI or payment request - 打开一个暗黑币:URI或者付款请求 + 打开达世币:网页或付款请求 @@ -606,7 +607,7 @@ This product includes software developed by the OpenSSL Project for use in the O Show the Dash Core help message to get a list with possible Dash command-line options - 显示暗黑币内核帮助信息并以列表形式展示可用的暗黑币命令行选项 + 打开达世币核心帮助信息取得可使用的命令行列表 @@ -637,12 +638,12 @@ This product includes software developed by the OpenSSL Project for use in the O Dash client - 暗黑币客户端 + 达世币客户端 %n active connection(s) to Dash network - %n (个)至暗黑币网络的有效连接 + %n 已连接至达世币网络 @@ -723,7 +724,7 @@ This product includes software developed by the OpenSSL Project for use in the O Dash - 暗黑币 + 达世币 @@ -781,7 +782,7 @@ Address: %4 A fatal error occurred. Dash can no longer continue safely and will quit. - 发生致命错误。暗黑币客户端将关闭。 + 发生严重错误。达世币不能继续提供安全性,将退出。 @@ -857,7 +858,7 @@ Address: %4 (1 locked) - + (1 锁定) @@ -1116,32 +1117,32 @@ Address: %4 Basic Privacy - + 基本隐私 High Privacy - + 高度隐私 Maximum Privacy - + 最大隐私 Please select a privacy level. - + 请选择隐私等级。 Use 2 separate masternodes to mix funds up to 1000 DASH - 使用2个独立主节点进行混合至多1000个DASH + 使用2个独立的主节点混合资金最多1000达世币 Use 8 separate masternodes to mix funds up to 1000 DASH - 使用8个独立主节点进行混合至多1000个DASH + 使用8个独立的主节点混合资金最多1000达世币 @@ -1151,17 +1152,17 @@ Address: %4 This option is the quickest and will cost about ~0.025 DASH to anonymize 1000 DASH - 此选项提供最快速度并且将花费大概0.025DRK的费用以匿名化1000DRK + 此选项为最快速度,需要支付0.025达世币/1000达世币的匿名处理费用。 This option is moderately fast and will cost about 0.05 DASH to anonymize 1000 DASH - 此选项提供中等速度并且将花费大概0.05DRK的费用以匿名化1000DRK + 此选项为一般速度,需要支付0.05达世币/1000达世币的匿名处理费用。 0.1 DASH per 1000 DASH you anonymize. - 0.1DRK每匿名化1000DRK + 0.1达世币/1000达世币的匿名处理费用。 @@ -1178,17 +1179,17 @@ Address: %4 Darksend was successfully set to basic (%1 and 2 rounds). You can change this at any time by opening Dash's configuration screen. - 匿名发送已成功设置为基本配置(%1 至 2轮循环)。你可以通过打开暗黑币的配置界面随时改变此配置。 + 匿名发送已成功设置为一般(%1到2次循环)。可以通过打开达世币配置窗口来随时修改。 Darksend was successfully set to high (%1 and 8 rounds). You can change this at any time by opening Dash's configuration screen. - 匿名发送已成功设置为高循环配置(%1 至 8轮循环)。你可以通过打开暗黑币的配置界面随时改变此配置。 + 匿名发送已成功设置为高(%1到8次循环)。可以通过打开达世币配置窗口来随时修改。 Darksend was successfully set to maximum (%1 and 16 rounds). You can change this at any time by opening Dash's configuration screen. - 匿名发送已成功设置为最大循环配置(%1 至 16轮循环)。你可以通过打开暗黑币的配置界面随时改变此配置。 + 匿名发送已成功设置为最高(%1到16次循环)。可以通过打开达世币配置窗口来随时修改。 @@ -1241,7 +1242,7 @@ Address: %4 The entered address "%1" is not a valid Dash address. - 此"%1"地址不是暗黑币有效地址 + 输入的地址"%1"不是有效的达世币地址。 @@ -1292,12 +1293,12 @@ Address: %4 Dash Core - Command-line options - 暗黑币内核 - 命令行选项 + 达世币核心 - 命令行选项 Dash Core - 暗黑币 内核 + 达世币核心 @@ -1356,17 +1357,17 @@ Address: %4 Welcome to Dash Core. - 欢迎来到暗黑币内核 + 欢迎来到达世币核心。 As this is the first time the program is launched, you can choose where Dash Core will store its data. - 本次启动是您第一次使用,您可以选择将暗黑币内核程序相应的数据文件存储在您想存储的文件路径 + 此次为第一次程序启动,你可以选择储存达世币核心数据的路径。 Dash Core will download and store a copy of the Dash block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. - 暗黑币内核程序将开始下载并存储一份暗黑币数据块链资源。至少%1GB大小的数据将被保存在这个路径下。该数据会随着日后使用而增加其大小。您的钱包同样也会被保存在这个路径下。 + 达世币核心将会下载并存储达世币数据链。至少有%1GB的数据会保存到此路径下,并且随着时间增长。钱包文件也将存储到此路径下。 @@ -1381,7 +1382,7 @@ Address: %4 Dash - 暗黑币 + 达世币 @@ -1447,12 +1448,12 @@ Address: %4 Automatically start Dash after logging in to the system. - 登录系统后自动启动暗黑币客户端 + 登录系统后自动启动达世币程序 &Start Dash on system login - 登录后启动暗黑币(&S) + &系统登录时启动达世币程序 @@ -1492,7 +1493,7 @@ Address: %4 Amount of Dash to keep anonymized - 匿名化暗黑币数量 + 保持匿名化的达世币数 @@ -1542,7 +1543,7 @@ Address: %4 Automatically open the Dash client port on the router. This only works when your router supports UPnP and it is enabled. - 自动在路由器上打开暗黑币客户端端口。此项设置仅在您的路由器支持UPnP功能并且处于打开情况下才可正常工作 + 自动对路由器打开达世币客户端端口。此项只在路由器支持UPnP时有效。 @@ -1552,7 +1553,7 @@ Address: %4 Connect to the Dash network through a SOCKS proxy. - 通过SOCKS代理连接暗黑币网络。 + 通过SOCKS代理链接达世币网络。 @@ -1627,13 +1628,14 @@ Address: %4 The user interface language can be set here. This setting will take effect after restarting Dash. - 在此可以进行设置用户界面的语言。此设置需要重启暗黑币客户端以生效 + 用户界面语言在这里设置。在重启达世币程序后生效。 Language missing or translation incomplete? Help contributing translations here: https://www.transifex.com/projects/p/dash/ - + 缺少相关语言或翻译不完整? 请到这里协助翻译: +https://www.transifex.com/projects/p/dash/ @@ -1643,12 +1645,12 @@ https://www.transifex.com/projects/p/dash/ Choose the default subdivision unit to show in the interface and when sending coins. - 选择比特币单位。 + 选择达世币单位。 Whether to show Dash addresses in the transaction list or not. - 是否在交易列表中显示暗黑币地址。 + 是否显示交易列表中的达世币地址。 @@ -1745,7 +1747,7 @@ https://www.transifex.com/projects/p/dash/ The displayed information may be out of date. Your wallet automatically synchronizes with the Dash network after a connection is established, but this process has not completed yet. - 显示的信息可能已过期。在建立连接后您的钱包自动与暗黑币网络同步数据,此同步过程目前尚未完毕。 + 显示信息也许已过期。当与达世币网络连接后钱包程序会自动同步,但现在还未完成。 @@ -1810,7 +1812,7 @@ https://www.transifex.com/projects/p/dash/ 0 DASH - 0 DASH + 0 达世币 @@ -1820,7 +1822,7 @@ https://www.transifex.com/projects/p/dash/ 0 DASH / 0 Rounds - 0 DASH/ 0 轮循环 + 0 达世币 / 0 循环数 @@ -1942,7 +1944,7 @@ https://www.transifex.com/projects/p/dash/ Mixing in progress... - + 混淆中... @@ -2062,7 +2064,7 @@ https://www.transifex.com/projects/p/dash/ Cannot start dash: click-to-pay handler - 不能启动暗黑币:click-to-pay handler + 无法启动达世币程序:click-to-pay handler @@ -2088,7 +2090,7 @@ https://www.transifex.com/projects/p/dash/ URI can not be parsed! This can be caused by an invalid Dash address or malformed URI parameters. - URI无法被解析!此问题可能是由无效的暗黑币地址或者无效的URI参数导致。 + 链接不能被解析! 原因可能是无效的达世币地址或输入的链接有错。 @@ -2149,7 +2151,7 @@ https://www.transifex.com/projects/p/dash/ Dash - 暗黑币 + 达世币 @@ -2174,12 +2176,13 @@ https://www.transifex.com/projects/p/dash/ Dash Core didn't yet exit safely... - 暗黑币内核尚未安全退出... + 达世币核心还未安全退出... Enter a Dash address (e.g. XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) - 输入一个暗黑币地址(如 XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) + 输入达世币地址(如. +XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) @@ -2259,7 +2262,7 @@ https://www.transifex.com/projects/p/dash/ Open the Dash debug log file from the current data directory. This can take a few seconds for large log files. - 从目前数据路径下打开暗黑币的调试日志。如果您的日志文件比较大可能会多花费一些时间。 + 从数据路径打开达世币Debug日志,这个过程可能需要几秒钟。 @@ -2351,7 +2354,7 @@ https://www.transifex.com/projects/p/dash/ Welcome to the Dash RPC console. - 欢迎来到暗黑币RPC控制台。 + 欢迎来到达世币RPC控制台。 @@ -2415,7 +2418,7 @@ https://www.transifex.com/projects/p/dash/ An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Dash network. - 可在付款请求中附加一条消息,当打开此请求时会显示这条消息。 注意:此条消息不会随着该请求被暗黑币网络发送。 + 附加在付款要求中的讯息,可以不填,打开要求内容时会显示。注意: 这个讯息不会随着付款送到达世币网路上。 @@ -2739,7 +2742,7 @@ https://www.transifex.com/projects/p/dash/ InstantX - + 即时支付 @@ -2812,7 +2815,7 @@ https://www.transifex.com/projects/p/dash/ and InstantX - + 和 即时支付 @@ -2830,7 +2833,7 @@ https://www.transifex.com/projects/p/dash/ are added as transaction fee - + 作为交易费被添加 @@ -2890,7 +2893,7 @@ https://www.transifex.com/projects/p/dash/ The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here. - 错误:该交易被拒绝!发生这种错误的原因可能是:钱包中的比特币已经被用掉,有可能您复制了wallet.dat钱包文件,然后用复制的钱包文件支付了比特币,但是这个钱包文件中没有记录。 + 错误:该交易被拒绝!发生这种错误的原因可能是:钱包中的达世币已经被用掉,有可能您复制了wallet.dat钱包文件,然后用复制的钱包文件支付了达世币,但是这个钱包文件中没有记录。 @@ -2900,7 +2903,7 @@ https://www.transifex.com/projects/p/dash/ Warning: Invalid Dash address - 警告:无效的暗黑币地址 + 警告:无效的达世币地址 @@ -3017,7 +3020,7 @@ https://www.transifex.com/projects/p/dash/ Dash Core is shutting down... - + 达世币核心正在关闭... @@ -3087,7 +3090,7 @@ https://www.transifex.com/projects/p/dash/ Sign the message to prove you own this Dash address - + 签署信息证明你拥有此达世币地址 @@ -3123,7 +3126,7 @@ https://www.transifex.com/projects/p/dash/ Verify the message to ensure it was signed with the specified Dash address - + 验证信息用来确保此被签署信息对应相对的达世币地址 @@ -3143,7 +3146,8 @@ https://www.transifex.com/projects/p/dash/ Enter a Dash address (e.g. XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) - 输入一个暗黑币地址(如 XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) + 输入达世币地址(如. +XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg) @@ -3217,12 +3221,12 @@ https://www.transifex.com/projects/p/dash/ Dash Core - 暗黑币 内核 + 达世币核心 Version %1 - + 版本 %1 @@ -3232,7 +3236,7 @@ https://www.transifex.com/projects/p/dash/ The Dash Core developers - Dash Core 的开发者 + 达世币核心开发人员 @@ -3253,7 +3257,7 @@ https://www.transifex.com/projects/p/dash/ Open for %n more block(s) - + 对于%n个块开放 @@ -3271,17 +3275,17 @@ https://www.transifex.com/projects/p/dash/ %1/offline (verified via instantx) - + %1/下线(经过即时支付系统认证) %1/confirmed (verified via instantx) - + %1/已确认(经过即时支付系统认证) %1 confirmations (verified via instantx) - + %1/确认完成(经过即时支付付系统认证) @@ -3302,27 +3306,27 @@ https://www.transifex.com/projects/p/dash/ %1/offline (InstantX verification in progress - %2 of %3 signatures) - + %1/下线 (即时支付系统正在认证中 - %2 of %3签名数) %1/confirmed (InstantX verification in progress - %2 of %3 signatures ) - + %1/已确认 (即时支付系统正在认证中 - %2 of %3签名数) %1 confirmations (InstantX verification in progress - %2 of %3 signatures) - + %1/确认完成 (即时支付系统正在认证中 - %2 of %3签名数) %1/offline (InstantX verification failed) - + %1/下线 (即时支付系统认证失败) %1/confirmed (InstantX verification failed) - + %1/已确认 (即时支付系统认证失败) @@ -3337,7 +3341,7 @@ https://www.transifex.com/projects/p/dash/ , broadcast through %n node(s) - + ,通过%n(多个)节点广播 @@ -3444,7 +3448,7 @@ https://www.transifex.com/projects/p/dash/ Generated coins must mature %1 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours. - 生成的比特币在可以使用前必须有 %1 个成熟的区块。当您生成了此区块后,它将被广播到网络中以加入区块链。如果它未成功进入区块链,其状态将变更为“不接受”并且不可使用。这可能偶尔会发生,如果另一个节点比你早几秒钟成功生成一个区块。 + 生成的达世币在可以使用前必须有 %1 个成熟的区块。当您生成了此区块后,它将被广播到网络中以加入区块链。如果它未成功进入区块链,其状态将变更为“不接受”并且不可使用。这可能偶尔会发生,如果另一个节点比你早几秒钟成功生成一个区块。 @@ -3515,7 +3519,7 @@ https://www.transifex.com/projects/p/dash/ Open for %n more block(s) - + 对于%n(多)个块开放 @@ -3575,7 +3579,7 @@ https://www.transifex.com/projects/p/dash/ Received via Darksend - + 已通过匿名处理接收 @@ -3595,12 +3599,12 @@ https://www.transifex.com/projects/p/dash/ Darksend Denominate - + 匿名发送面额化 Darksend Collateral Payment - + 匿名发送附加费用 @@ -3615,7 +3619,7 @@ https://www.transifex.com/projects/p/dash/ Darksent - + 匿名发送 @@ -3699,7 +3703,7 @@ https://www.transifex.com/projects/p/dash/ Darksent - + 匿名发送 @@ -3714,12 +3718,12 @@ https://www.transifex.com/projects/p/dash/ Darksend Denominate - + 匿名发送面额化 Darksend Collateral Payment - + 匿名发送附加费用 @@ -3866,7 +3870,7 @@ https://www.transifex.com/projects/p/dash/ Send Coins - 发送比特币 + 发送达世币 @@ -3937,27 +3941,27 @@ for example: alertnotify=echo %%s | mail -s "Dash Alert" admin@foo.com Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) - + 可接受的密码 (默认: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH) An error occurred while setting up the RPC port %u for listening on IPv4: %s - + 建立RPC服务时发生了一个错误%u 正在监听 IPv4: %s An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s - + 建立RPC服务时发生了一个错误%u 正在监听 IPv6,失败回滚至IPv4: %s Bind to given address and always listen on it. Use [host]:port notation for IPv6 - + 与提供地址绑定,持续监听。使用[host]:标记IPv6端口 Cannot obtain a lock on data directory %s. Dash Core is probably already running. - + 不能获得锁定的数据目录 %s. 达世币核心可能已经在运行。 @@ -3972,12 +3976,12 @@ for example: alertnotify=echo %%s | mail -s "Dash Alert" admin@foo.com Disable all Masternode and Darksend related functionality (0-1, default: 0) - + 禁止所有主节点和与匿名发送相关功能(0-1,默认:0) Enable instantx, show confirmations for locked transactions (bool, default: true) - + 激活即时支付,显示锁定交易的确认数(bool, 默认:true) @@ -4147,32 +4151,32 @@ for example: alertnotify=echo %%s | mail -s "Dash Alert" admin@foo.com Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction. - + 警告: -paytxfee 设定了很高的金额!这可是你交易付款所要付的手续费。 Warning: Please check that your computer's date and time are correct! If your clock is wrong Dash will not work properly. - + 警告: 请检查电脑日期和时间是否正确!达世币核心没办法在时钟不准的情况下正常运作。 Warning: The network does not appear to fully agree! Some miners appear to be experiencing issues. - + 警告: 达世币网路对于区块链结的决定目前有分歧!看来有些矿工会有问题。 Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade. - + 警告: 我们和某些连线的节点对于区块链结的决定不同!你可能需要升级,或是需要等其它的节点升级。 Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect. - + 警告: 读取钱包档wallet.dat 时发生错误!所有的密钥都正确读取了,但是交易资料或位址簿资料可能会缺少或不正确。 Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup. - + 警告: 钱包档wallet.dat 损坏,但资料被拯救回来了!原来的wallet.dat 会改储存在%s, 档名是wallet.{timestamp}.bak. 如果余额或交易资料有误,你应该要用备份资料复原回来。 @@ -4184,177 +4188,177 @@ If the file does not exist, create it with owner-readable-only file permissions. You must specify a masternodeprivkey in the configuration. Please see documentation for help. - + 您必须在配置中指定一个主节点密钥。请参阅文档以获得帮助。 (default: 1) - + (默认: 1) (default: wallet.dat) - + (默认: wallet.dat) <category> can be: - + <category> 可以是: Accept command line and JSON-RPC commands - + 接受命令行以及JSON-RPC命令 Accept connections from outside (default: 1 if no -proxy or -connect) - + 接受来自外部链接 (默认: 1 if no -proxy or -connect) Add a node to connect to and attempt to keep the connection open - + 添加一个可连接节点,并尝试保持连接开放。 Allow DNS lookups for -addnode, -seednode and -connect - + 允许DNS查找 -新节点, -子节点 和 -链接 Allow JSON-RPC connections from specified IP address - + 允许从指定IP地址连接JSON-RPC Already have that input. - + 输入已存在。 Always query for peer addresses via DNS lookup (default: 0) - + 总是通过DNS查询对等地址(默认: 0) Attempt to recover private keys from a corrupt wallet.dat - + 尝试从已损坏的钱包文件中找回私钥 Block creation options: - + 数据块创建选项: Can't denominate: no compatible inputs left. - + 不能面额化:没有可匹配的输入。 Cannot downgrade wallet - + 不能降级钱包 Cannot resolve -bind address: '%s' - + 不能解决 -绑定地址:'%s' Cannot resolve -externalip address: '%s' - + 不能解决 -外部ip地址:'%s' Cannot write default address - + 不能写入默认钱包 Clear list of wallet transactions (diagnostic tool; implies -rescan) - + 清除钱包交易列表 (检测工具; implies -rescan) Collateral is not valid. - + 并行是无效的。 Collateral not valid. - + 并行无效。 Connect only to the specified node(s) - + 连接至指定(多个)节点 Connect through SOCKS proxy - + 通过SOCKS代理连接 Connect to JSON-RPC on <port> (default: 9998 or testnet: 19998) - + 连接至JSON-RPC<端口>(默认:9998 或 测试网络:19998) Connect to KeePassHttp on port <port> (default: 19455) - + 连接至 KeePassHttp 端口 <port> (默认: 19455) Connect to a node to retrieve peer addresses, and disconnect - + 连接至节点来找回对等地址和断开链接 Connection options: - + 连接选项: Corrupted block database detected - + 已找到损坏的数据块 Dash Core Daemon - + 达世币核心后台程序 Dash Core RPC client version - + 达世币核心RPC客户端版本 Darksend is disabled. - + 匿名发送未激活。 Darksend options: - + 匿名发送选项: Debugging/Testing options: - + 排除故障/测试 选项: Disable safemode, override a real safe mode event (default: 0) - + 未激活安全模式,重新写入真正安全模式项目(默认: 0) Discover own IP address (default: 1 when listening and no -externalip) - + 发现私有IP地址(默认:1 当监听时没有外部IP) @@ -4364,12 +4368,12 @@ If the file does not exist, create it with owner-readable-only file permissions. Do you want to rebuild the block database now? - + 你想要现在重建区块资料库吗? Done loading - + 读取完成 @@ -4379,7 +4383,7 @@ If the file does not exist, create it with owner-readable-only file permissions. Enable the client to act as a masternode (0-1, default: 0) - + 激活客户端,使其作为主节点(0-1, 默认:0) @@ -4389,52 +4393,52 @@ If the file does not exist, create it with owner-readable-only file permissions. Error connecting to masternode. - + 连接到主节点时发生错误。 Error initializing block database - + 正在初始化数据库块错误 Error initializing wallet database environment %s! - + 正在初始钱包数据库环境错误 %s! Error loading block database - + 读取数据库块错误 Error loading wallet.dat - + 读取钱包文件错误 Error loading wallet.dat: Wallet corrupted - + 读取钱包文件错误:钱包已损坏 Error loading wallet.dat: Wallet requires newer version of Dash - + 读取钱包文件错误:需要较为新版本的达世币程序来读取钱包 Error opening block database - + 正在打开数据库块错误 Error reading from database, shutting down. - + 读取数据库错误,正在关闭。 Error recovering public key. - + 恢复公钥时发生错误。 @@ -4459,62 +4463,62 @@ If the file does not exist, create it with owner-readable-only file permissions. Error: system error: - + 错误:系统错误: Failed to listen on any port. Use -listen=0 if you want this. - + 监听端口失败。如果想使用此项 修改-listen=0 Failed to read block info - + 读取数据块信息失败 Failed to read block - + 读取数据块失败 Failed to sync block index - + 同步数据块索引失败 Failed to write block index - + 写入数据块索引失败 Failed to write block info - + 写入数据块信息失败 Failed to write block - + 写入数据块失败 Failed to write file info - + 写入文件信息失败 Failed to write to coin database - + 写入币的数据库失败 Failed to write transaction index - + 写入交易索引失败 Failed to write undo data - + 写入撤回数据失败 @@ -4559,22 +4563,22 @@ If the file does not exist, create it with owner-readable-only file permissions. Importing... - + 正在导入... Imports blocks from external blk000??.dat file - + 从其它来源的 blk000??.dat 档汇入区块 Incompatible mode. - + 不兼容模式。 Incompatible version. - + 不兼容版本。 @@ -4589,37 +4593,37 @@ If the file does not exist, create it with owner-readable-only file permissions. Initialization sanity check failed. Dash Core is shutting down. - + 初始化检查失败。达世币核心正在关闭。 Input is not valid. - + 输入是无效的。 InstantX options: - + 即时支付 选项: Insufficient funds - + 存款不足 Insufficient funds. - + 存款不足。 Invalid -onion address: '%s' - + 无效-洋葱头地址:'%s' Invalid -proxy address: '%s' - + 无效-代理地址:'%s' @@ -4639,22 +4643,22 @@ If the file does not exist, create it with owner-readable-only file permissions. Invalid amount - + 无效金额 Invalid masternodeprivkey. Please see documenation. - + 无效主节点私钥。请查阅文件材料。 Invalid private key. - + 无效私钥。 Invalid script detected. - + 检测到无效脚本。 @@ -4684,12 +4688,12 @@ If the file does not exist, create it with owner-readable-only file permissions. Last Darksend was too recent. - + 最后一次匿名发送刚刚完成。 Last successful darksend action was too recent. - + 最后一次成功匿名发送刚刚完成。 @@ -4699,22 +4703,22 @@ If the file does not exist, create it with owner-readable-only file permissions. List commands - + 命令列表 Listen for connections on <port> (default: 9999 or testnet: 19999) - + Listen for connections on <port> (default: 9999 or testnet: 19999) Loading addresses... - + 正在读取地址... Loading block index... - + 正在读取数据块索引... @@ -4724,12 +4728,12 @@ If the file does not exist, create it with owner-readable-only file permissions. Loading wallet... (%3.2f %%) - + 正在读取钱包...(%3.2f%%) Loading wallet... - + 正在读取钱包... @@ -4739,27 +4743,27 @@ If the file does not exist, create it with owner-readable-only file permissions. Maintain a full transaction index (default: 0) - + 保持全部的交易索引(默认: 0) Maintain at most <n> connections to peers (default: 125) - + 保持对节点最高的 <n>连接数 (默认: 125) Masternode options: - + 主节点选项: Masternode queue is full. - + 主节点列队已满。 Masternode: - + 主节点: @@ -4774,97 +4778,97 @@ If the file does not exist, create it with owner-readable-only file permissions. Missing input transaction information. - + 丢失输入交易信息。 No compatible masternode found. - + 没有找到任何兼容的主节点。 No funds detected in need of denominating. - + 在面额化过程中没有检测到所需的资金。 No masternodes detected. - + 没有检测到任何主节点。 No matching denominations found for mixing. - + 对于混淆处理,没有找到匹配的面额资金。 Non-standard public key detected. - + 检测到非标准的公钥。 Not compatible with existing transactions. - + 与已存在交易不匹配。 Not enough file descriptors available. - + 文件说明符不可用 Not in the masternode list. - + 在主节点列表中不存在。 Only accept block chain matching built-in checkpoints (default: 1) - + 只接受与镶入检验点匹配的数据块链 (默认: 1) Only connect to nodes in network <net> (IPv4, IPv6 or Tor) - + 在网络中只连接至节点 <net> (IPv4, IPv6 or Tor) Options: - + 选项: Password for JSON-RPC connections - + JSON-RPC连接密码 Prepend debug output with timestamp (default: 1) - + 通过时间标记预先调试输出 (默认: 1) Print block on startup, if found in block index - + 如果在块索引中找到,在启动时打印块 Print block tree on startup (default: 0) - + 在启动时打印块树(默认:0) RPC SSL options: (see the Bitcoin Wiki for SSL setup instructions) - + RPC SSL选项: (请在比特币维基百科查看SSL建立说明) RPC client options: - + RPC客户端选项: RPC server options: - + RPC服务器选项: @@ -4879,277 +4883,277 @@ If the file does not exist, create it with owner-readable-only file permissions. Rebuild block chain index from current blk000??.dat files - + 从现在的blk000??.dat文件重新建立数据块链索引 Rescan the block chain for missing wallet transactions - + 对丢失的钱包交易重新扫描数据块链 Rescanning... - + 正在重新扫描... Run a thread to flush wallet periodically (default: 1) - + 启用定期将变动写入​​钱包档的执行绪(默认: 1) Run in the background as a daemon and accept commands - + 运行至后台并且接受命令 SSL options: (see the Bitcoin Wiki for SSL setup instructions) - + SSL 选项: (请在比特币维基百科查看SSL建立说明) Select SOCKS version for -proxy (4 or 5, default: 5) - + 为-代理 选择SOCKS版本 (4 or 5, 默认: 5) Send command to Dash Core - + 发送命令至达世币核心 Send commands to node running on <ip> (default: 127.0.0.1) - + 发送命令至运行于 <ip>的节点 (默认: 127.0.0.1) Send trace/debug info to console instead of debug.log file - + 发送追踪/debug信息而并非debug.log文件至控制台 Server certificate file (default: server.cert) - + 服务器证书文件(默认: server.cert) Server private key (default: server.pem) - + 服务器私钥 (默认: server.pem) Session not complete! - + 对话未完成! Session timed out (30 seconds), please resubmit. - + 对话超时 (30 秒),请重新递交。 Set database cache size in megabytes (%d to %d, default: %d) - + 以兆字节为单位设置缓存数据大小 (%d to %d, 默认: %d) Set key pool size to <n> (default: 100) - + 设置钥匙池大小至<n> (默认: 100) Set maximum block size in bytes (default: %d) - + 以字节为单位设置最大的块(默认: 0) Set minimum block size in bytes (default: 0) - + 以字节为单位设置最小的块(默认: 0) Set the masternode private key - + 设置主节点私钥 Set the number of threads to service RPC calls (default: 4) - + 设定处理RPC 服务请求的执行绪数目(默认: 4) Sets the DB_PRIVATE flag in the wallet db environment (default: 1) - + 在钱包资料库环境变数设定DB_PRIVATE 旗标(默认: 1) Show all debugging options (usage: --help -help-debug) - + 显示所有debug选项(使用: --help -help-debug) Show benchmark information (default: 0) - + 显示基准信息(默认: 0) Shrink debug.log file on client startup (default: 1 when no -debug) - + 客户启动时缩小debug.log文件(默认: 1 when no -debug) Signing failed. - + 签名失败。 Signing timed out, please resubmit. - + 签名超时,请重新递交。 Signing transaction failed - + 交易签名失败 Specify configuration file (default: dash.conf) - + 指定配置文件(默认: dash.conf) Specify connection timeout in milliseconds (default: 5000) - + 指定连接超时毫秒数 (默认: 5000) Specify data directory - + 指定数据目录 Specify masternode configuration file (default: masternode.conf) - + 指定主节点配置文件 (默认: masternode.conf) Specify pid file (default: dashd.pid) - + 指定pid 文件 (默认: dashd.pid) Specify wallet file (within data directory) - + 指定钱包文件(通过数据目录) Specify your own public address - + 指定你个人公开地址 Spend unconfirmed change when sending transactions (default: 1) - + 发送交易时花费未确认的费用(默认: 1) Start Dash Core Daemon - + 启动达世币核心后台程序 System error: - + 系统错误: This help message - + 此帮助信息 This is intended for regression testing tools and app development. - + 这被用来作为回归测试工具和app的开发。 This is not a masternode. - + 这并不是主节点。 Threshold for disconnecting misbehaving peers (default: 100) - + 断开的作弊节点临界值(默认: 100) To use the %s option - + 使用%s选项 Transaction amount too small - + 交易额过小 Transaction amounts must be positive - + 交易额一定要真实有效 Transaction created successfully. - + 交易创建成功。 Transaction fees are too high. - + 交易费用过高。 Transaction not valid. - + 交易无效。 Transaction too large - + 交易过大 Unable to bind to %s on this computer (bind returned error %s) - + 无法绑定%s此计算机 (绑定返回错误 %s) Unable to sign masternode payment winner, wrong key? - + 无法标记主节点奖励得主,错误钥匙? Unable to sign spork message, wrong key? - + 无法签署交叉信息,错误的密钥? Unknown -socks proxy version requested: %i - + 未知-socks代理版本请求:%i Unknown network specified in -onlynet: '%s' - + 在 -onlynet 指定了不明的网路别: '%s' Upgrade wallet to latest format - + 升级钱包至最新版本 Usage (deprecated, use dash-cli): - + 用量(不赞成, 使用 dash-cli): @@ -5164,72 +5168,72 @@ If the file does not exist, create it with owner-readable-only file permissions. Use N separate masternodes to anonymize funds (2-8, default: 2) - + 使用N个独立主节点匿名处理资金(2-8,默认:2) Use OpenSSL (https) for JSON-RPC connections - + 对JSON-RPC链接使用OpenSSL(https) Use UPnP to map the listening port (default: 0) - + 使用UPnP来映射监听端口(默认:0) Use UPnP to map the listening port (default: 1 when listening) - + 使用UPnP来映射监听端口(默认:1为监听中) Use the test network - + 使用测试网络 Username for JSON-RPC connections - + 链接JSON-RPC的用户名 Value more than Darksend pool maximum allows. - + 数值超过匿名发送池所允许的最大数。 Verifying blocks... - + 验证数据块中... Verifying wallet... - + 验证钱包中... Wait for RPC server to start - + 等待RPC服务器启动 Wallet %s resides outside data directory %s - + 钱包 %s 属于外部数据目录 %s Wallet is locked. - + 钱包被锁。 Wallet needed to be rewritten: restart Dash to complete - + 钱包需要重新写入:请重启Dash来完成过程 Wallet options: - + 钱包选项: @@ -5239,12 +5243,12 @@ If the file does not exist, create it with owner-readable-only file permissions. Warning: Deprecated argument -debugnet ignored, use -debug=net - + 警告:忽略使用参数-debugnet ,使用-debug =net Warning: This version is obsolete, upgrade required! - + 警告:版本过低,请升级! Wrong state. @@ -5253,17 +5257,17 @@ If the file does not exist, create it with owner-readable-only file permissions. You need to rebuild the database using -reindex to change -txindex - + 你需要通过使用-reindex改变-txindex来重新建立数据库 Zapping all transactions from wallet... - + 从钱包正在展开所有交易记录... on startup - + 正在启动 @@ -5273,7 +5277,7 @@ If the file does not exist, create it with owner-readable-only file permissions. wallet.dat corrupt, salvage failed - + 钱包数据损坏,恢复失败 \ No newline at end of file From 27514f0f806d06ce823e62f2aa88c680d58e4cfe Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Wed, 8 Apr 2015 05:07:25 +0300 Subject: [PATCH 15/23] masternode stop should disable MN and remove it from MN list --- src/activemasternode.cpp | 5 ++++- src/masternodeman.cpp | 42 ++++++++++++++++++++++++++-------------- src/masternodeman.h | 5 +++-- 3 files changed, 35 insertions(+), 17 deletions(-) diff --git a/src/activemasternode.cpp b/src/activemasternode.cpp index c572a4b4b..cf494bb21 100644 --- a/src/activemasternode.cpp +++ b/src/activemasternode.cpp @@ -211,7 +211,10 @@ bool CActiveMasternode::Dseep(CTxIn vin, CService service, CKey keyMasternode, C CMasternode* pmn = mnodeman.Find(vin); if(pmn != NULL) { - pmn->UpdateLastSeen(); + if(stop) + mnodeman.Remove(pmn->vin); + else + pmn->UpdateLastSeen(); } else { diff --git a/src/masternodeman.cpp b/src/masternodeman.cpp index afaed60a1..e0db46724 100644 --- a/src/masternodeman.cpp +++ b/src/masternodeman.cpp @@ -541,20 +541,6 @@ void CMasternodeMan::ProcessMasternodeConnections() } } -void CMasternodeMan::RelayMasternodeEntry(const CTxIn vin, const CService addr, const std::vector vchSig, const int64_t nNow, const CPubKey pubkey, const CPubKey pubkey2, const int count, const int current, const int64_t lastUpdated, const int protocolVersion, CScript donationAddress, int donationPercentage) -{ - LOCK(cs_vNodes); - BOOST_FOREACH(CNode* pnode, vNodes) - pnode->PushMessage("dsee", vin, addr, vchSig, nNow, pubkey, pubkey2, count, current, lastUpdated, protocolVersion, donationAddress, donationPercentage); -} - -void CMasternodeMan::RelayMasternodeEntryPing(const CTxIn vin, const std::vector vchSig, const int64_t nNow, const bool stop) -{ - LOCK(cs_vNodes); - BOOST_FOREACH(CNode* pnode, vNodes) - pnode->PushMessage("dseep", vin, vchSig, nNow, stop); -} - void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CDataStream& vRecv) { @@ -895,6 +881,34 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData } +void CMasternodeMan::RelayMasternodeEntry(const CTxIn vin, const CService addr, const std::vector vchSig, const int64_t nNow, const CPubKey pubkey, const CPubKey pubkey2, const int count, const int current, const int64_t lastUpdated, const int protocolVersion, CScript donationAddress, int donationPercentage) +{ + LOCK(cs_vNodes); + BOOST_FOREACH(CNode* pnode, vNodes) + pnode->PushMessage("dsee", vin, addr, vchSig, nNow, pubkey, pubkey2, count, current, lastUpdated, protocolVersion, donationAddress, donationPercentage); +} + +void CMasternodeMan::RelayMasternodeEntryPing(const CTxIn vin, const std::vector vchSig, const int64_t nNow, const bool stop) +{ + LOCK(cs_vNodes); + BOOST_FOREACH(CNode* pnode, vNodes) + pnode->PushMessage("dseep", vin, vchSig, nNow, stop); +} + +void CMasternodeMan::Remove(CTxIn vin) +{ + LOCK(cs); + + vector::iterator it = vMasternodes.begin(); + while(it != vMasternodes.end()){ + if((*it).vin == vin){ + if(fDebug) LogPrintf("CMasternodeMan: Removing Masternode %s - %i now\n", (*it).addr.ToString().c_str(), size() - 1); + vMasternodes.erase(it); + break; + } + } +} + std::string CMasternodeMan::ToString() const { std::ostringstream info; diff --git a/src/masternodeman.h b/src/masternodeman.h index 31ad4cbb8..f1b043417 100644 --- a/src/masternodeman.h +++ b/src/masternodeman.h @@ -125,10 +125,10 @@ public: int GetMasternodeRank(const CTxIn &vin, int64_t nBlockHeight, int minProtocol=0, bool fOnlyActive=true); CMasternode* GetMasternodeByRank(int nRank, int64_t nBlockHeight, int minProtocol=0, bool fOnlyActive=true); - void ProcessMessage(CNode* pfrom, std::string& strCommand, CDataStream& vRecv); - void ProcessMasternodeConnections(); + void ProcessMessage(CNode* pfrom, std::string& strCommand, CDataStream& vRecv); + /// Return the number of (unique) Masternodes int size() { return vMasternodes.size(); } @@ -141,6 +141,7 @@ public: void RelayMasternodeEntry(const CTxIn vin, const CService addr, const std::vector vchSig, const int64_t nNow, const CPubKey pubkey, const CPubKey pubkey2, const int count, const int current, const int64_t lastUpdated, const int protocolVersion, CScript donationAddress, int donationPercentage); void RelayMasternodeEntryPing(const CTxIn vin, const std::vector vchSig, const int64_t nNow, const bool stop); + void Remove(CTxIn vin); }; From 7d5948012be83ab3aedcf1afc0b59dd9445eb977 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Wed, 8 Apr 2015 07:41:49 -0700 Subject: [PATCH 16/23] DS: Adjust Target Balance - When targeting the entire balance, the wallet reports getting stuck at 99%. --- src/qt/overviewpage.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index eb014ce11..003d64ee6 100755 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -300,6 +300,7 @@ void OverviewPage::updateDarksendProgress() { denomPart = (float)pwalletMain->GetNormalizedAnonymizedBalance() / denominatedBalance; denomPart = denomPart > 1 ? 1 : denomPart; + if(denomPart == 1) nMaxToAnonymize = denominatedBalance; } // % of fully anonymized balance @@ -313,7 +314,7 @@ void OverviewPage::updateDarksendProgress() // apply some weights to them (sum should be <=100) and calculate the whole progress int progress = 80 * denomPart + 20 * anonPart; - if(progress > 100) progress = 100; + if(progress >= 100) progress = 100; ui->darksendProgress->setValue(progress); From 3f57ac1aea1584ee5b09297437571974eaaa768f Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Wed, 8 Apr 2015 08:46:13 -0700 Subject: [PATCH 17/23] added debugging --- src/masternodeman.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/masternodeman.cpp b/src/masternodeman.cpp index e21391f8e..ee242e4b8 100644 --- a/src/masternodeman.cpp +++ b/src/masternodeman.cpp @@ -810,10 +810,15 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData int nVote; vRecv >> vin >> vchSig >> nVote; + LogPrintf("mvote - Masternode vote %s \n", vin.ToString().c_str()); + // see if we have this Masternode CMasternode* pmn = this->Find(vin); if(pmn != NULL) { + + LogPrintf("mvote - found %d %d \n", GetAdjustedTime(), pmn->lastVote); + if((GetAdjustedTime() - pmn->lastVote) > (60*60)) { std::string strMessage = vin.ToString() + boost::lexical_cast(nVote); @@ -836,6 +841,7 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData return; } + LogPrintf("mvote - end %s \n", vin.ToString().c_str()); } else if (strCommand == "dseg") { //Get Masternode list or specific entry From a4e8dfa0b6cdb4bb8ff12315b7905f48d646a933 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Wed, 8 Apr 2015 09:35:43 -0700 Subject: [PATCH 18/23] fixed issues --- src/masternodeman.cpp | 6 ------ src/rpcdarksend.cpp | 3 +-- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/masternodeman.cpp b/src/masternodeman.cpp index ee242e4b8..e21391f8e 100644 --- a/src/masternodeman.cpp +++ b/src/masternodeman.cpp @@ -810,15 +810,10 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData int nVote; vRecv >> vin >> vchSig >> nVote; - LogPrintf("mvote - Masternode vote %s \n", vin.ToString().c_str()); - // see if we have this Masternode CMasternode* pmn = this->Find(vin); if(pmn != NULL) { - - LogPrintf("mvote - found %d %d \n", GetAdjustedTime(), pmn->lastVote); - if((GetAdjustedTime() - pmn->lastVote) > (60*60)) { std::string strMessage = vin.ToString() + boost::lexical_cast(nVote); @@ -841,7 +836,6 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData return; } - LogPrintf("mvote - end %s \n", vin.ToString().c_str()); } else if (strCommand == "dseg") { //Get Masternode list or specific entry diff --git a/src/rpcdarksend.cpp b/src/rpcdarksend.cpp index a4dc70d46..2758134bd 100644 --- a/src/rpcdarksend.cpp +++ b/src/rpcdarksend.cpp @@ -596,7 +596,6 @@ Value masternode(const Array& params, bool fHelp) std::vector vchMasterNodeSignature; std::string strMasterNodeSignMessage; - CTxIn vin; CPubKey pubKeyCollateralAddress; CKey keyCollateralAddress; CPubKey pubKeyMasternode; @@ -635,7 +634,7 @@ Value masternode(const Array& params, bool fHelp) //send to all peers LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) - pnode->PushMessage("mvote", vin, vchMasterNodeSignature, nVote); + pnode->PushMessage("mvote", pmn->vin, vchMasterNodeSignature, nVote); } return("Voted successfully " + boost::lexical_cast(success) + " time(s) and failed " + boost::lexical_cast(failed) + " time(s)."); From 0f677c4583d83daefa30b84d31d172744aeeccba Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Wed, 8 Apr 2015 09:38:04 -0700 Subject: [PATCH 19/23] version bump / reduce max rounds options in conf --- configure.ac | 2 +- src/clientversion.h | 2 +- src/qt/forms/optionsdialog.ui | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 52eafbbb2..d156f22d3 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 0) define(_CLIENT_VERSION_MINOR, 11) define(_CLIENT_VERSION_REVISION, 2) -define(_CLIENT_VERSION_BUILD, 19) +define(_CLIENT_VERSION_BUILD, 20) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2015) AC_INIT([Dash Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@dashpay.io],[dash]) diff --git a/src/clientversion.h b/src/clientversion.h index f02234e53..14fb4e4b1 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -12,7 +12,7 @@ #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 11 #define CLIENT_VERSION_REVISION 2 -#define CLIENT_VERSION_BUILD 19 +#define CLIENT_VERSION_BUILD 20 diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui index 8a9195716..b1a4b2469 100755 --- a/src/qt/forms/optionsdialog.ui +++ b/src/qt/forms/optionsdialog.ui @@ -7,7 +7,7 @@ 0 0 576 - 400 + 402 @@ -148,7 +148,7 @@ 2 - 18 + 8 4 @@ -481,7 +481,7 @@ &Display - + @@ -535,7 +535,7 @@ https://www.transifex.com/projects/p/dash/ - + From a866e12f7440e18fcf84f847428985222358b137 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Wed, 8 Apr 2015 21:26:02 +0300 Subject: [PATCH 20/23] should set nMaxToAnonymize equal to denominatedBalance only if it's greater then it was possible to denominate --- src/qt/overviewpage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 003d64ee6..b0b26c095 100755 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -300,7 +300,7 @@ void OverviewPage::updateDarksendProgress() { denomPart = (float)pwalletMain->GetNormalizedAnonymizedBalance() / denominatedBalance; denomPart = denomPart > 1 ? 1 : denomPart; - if(denomPart == 1) nMaxToAnonymize = denominatedBalance; + if(denomPart == 1 && nMaxToAnonymize > denominatedBalance) nMaxToAnonymize = denominatedBalance; } // % of fully anonymized balance From 91a669e231efef3fc6037982c87fffea7d5db61b Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Thu, 9 Apr 2015 10:06:48 -0700 Subject: [PATCH 21/23] Ref-node : Always fill vecLastPayments - In some rare cases the vecLastPayments would get truncated and would start paying people it paid recently again. This stops that from happening. --- src/masternode.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/masternode.cpp b/src/masternode.cpp index 36b243ff5..16f383467 100644 --- a/src/masternode.cpp +++ b/src/masternode.cpp @@ -418,6 +418,7 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight) if(!enabled) return false; CMasternodePaymentWinner newWinner; int nMinimumAge = mnodeman.CountEnabled(); + CScript payeeSource; uint256 hash; if(!GetBlockHash(hash, nBlockHeight-10)) return false; @@ -430,8 +431,7 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight) BOOST_REVERSE_FOREACH(CMasternodePaymentWinner& winner, vWinning) { //if we already have the same vin - we have one full payment cycle, break - if(vecLastPayments.size() > 0 - && std::find(vecLastPayments.begin(), vecLastPayments.end(), winner.vin) != vecLastPayments.end()) break; + if(vecLastPayments.size() > nMinimumAge) break; vecLastPayments.push_back(winner.vin); } @@ -439,6 +439,8 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight) CMasternode *pmn = mnodeman.FindOldestNotInVec(vecLastPayments, nMinimumAge, 0); if(pmn != NULL) { + LogPrintf(" Found by FindOldestNotInVec \n"); + newWinner.score = 0; newWinner.nBlockHeight = nBlockHeight; newWinner.vin = pmn->vin; @@ -448,11 +450,15 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight) } else { newWinner.payee.SetDestination(pmn->pubkey.GetID()); } + + payeeSource.SetDestination(pmn->pubkey.GetID()); } //if we can't find new MN to get paid, pick first active MN counting back from the end of vecLastPayments list if(newWinner.nBlockHeight == 0 && nMinimumAge > 0) { + LogPrintf(" Find by reverse \n"); + BOOST_REVERSE_FOREACH(CTxIn& vinLP, vecLastPayments) { CMasternode* pmn = mnodeman.Find(vinLP); @@ -471,6 +477,8 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight) newWinner.payee.SetDestination(pmn->pubkey.GetID()); } + payeeSource.SetDestination(pmn->pubkey.GetID()); + break; // we found active MN } } @@ -482,7 +490,11 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight) ExtractDestination(newWinner.payee, address1); CBitcoinAddress address2(address1); - LogPrintf("Winner payee %s nHeight %d. \n", address2.ToString().c_str(), newWinner.nBlockHeight); + CTxDestination address3; + ExtractDestination(payeeSource, address3); + CBitcoinAddress address4(address3); + + LogPrintf("Winner payee %s nHeight %d vin source %s. \n", address2.ToString().c_str(), newWinner.nBlockHeight, address4.ToString().c_str()); if(Sign(newWinner)) { @@ -497,6 +509,7 @@ bool CMasternodePayments::ProcessBlock(int nBlockHeight) return false; } + void CMasternodePayments::Relay(CMasternodePaymentWinner& winner) { CInv inv(MSG_MASTERNODE_WINNER, winner.GetHash()); From e741ff590e1ecf3f4a114c9d1374df8dba479514 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Thu, 9 Apr 2015 10:12:04 -0700 Subject: [PATCH 22/23] version bump --- configure.ac | 2 +- src/clientversion.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index d156f22d3..61180245f 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 0) define(_CLIENT_VERSION_MINOR, 11) define(_CLIENT_VERSION_REVISION, 2) -define(_CLIENT_VERSION_BUILD, 20) +define(_CLIENT_VERSION_BUILD, 21) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2015) AC_INIT([Dash Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@dashpay.io],[dash]) diff --git a/src/clientversion.h b/src/clientversion.h index 14fb4e4b1..963f48254 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -12,7 +12,7 @@ #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 11 #define CLIENT_VERSION_REVISION 2 -#define CLIENT_VERSION_BUILD 20 +#define CLIENT_VERSION_BUILD 21 From a79196bc198834cf8750e644fe177d802ed60100 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Thu, 9 Apr 2015 12:17:32 -0700 Subject: [PATCH 23/23] fixed masternode find bug --- configure.ac | 2 +- src/clientversion.h | 2 +- src/masternodeman.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 61180245f..ee0abcef4 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 0) define(_CLIENT_VERSION_MINOR, 11) define(_CLIENT_VERSION_REVISION, 2) -define(_CLIENT_VERSION_BUILD, 21) +define(_CLIENT_VERSION_BUILD, 22) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2015) AC_INIT([Dash Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@dashpay.io],[dash]) diff --git a/src/clientversion.h b/src/clientversion.h index 963f48254..0528571c7 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -12,7 +12,7 @@ #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 11 #define CLIENT_VERSION_REVISION 2 -#define CLIENT_VERSION_BUILD 21 +#define CLIENT_VERSION_BUILD 22 diff --git a/src/masternodeman.cpp b/src/masternodeman.cpp index e21391f8e..67d3c04dd 100644 --- a/src/masternodeman.cpp +++ b/src/masternodeman.cpp @@ -327,7 +327,7 @@ CMasternode *CMasternodeMan::Find(const CTxIn &vin) BOOST_FOREACH(CMasternode& mn, vMasternodes) { - if(mn.vin == vin) + if(mn.vin.prevout == vin.prevout) return &mn; } return NULL;