From b0079d37ad7c927bbdb7d60e8ed043fcf1cc7f51 Mon Sep 17 00:00:00 2001 From: Mike Kinney Date: Wed, 4 Mar 2015 23:49:50 -0800 Subject: [PATCH 1/3] V0.11.2.x update comments --- src/darksend.cpp | 78 +++++++++++++++--------------- src/darksend.h | 123 ++++++++++++++++++++++++++++------------------- src/util.h | 2 + 3 files changed, 115 insertions(+), 88 deletions(-) diff --git a/src/darksend.cpp b/src/darksend.cpp index 068a10a398..5aa049035c 100644 --- a/src/darksend.cpp +++ b/src/darksend.cpp @@ -23,34 +23,34 @@ using namespace boost; CCriticalSection cs_darksend; -/** The main object for accessing darksend */ +// The main object for accessing Darksend CDarksendPool darkSendPool; -/** A helper object for signing messages from masternodes */ +// A helper object for signing messages from masternodes CDarkSendSigner darkSendSigner; -/** The current darksends in progress on the network */ +// The current Darksends in progress on the network std::vector vecDarksendQueue; -/** Keep track of the used masternodes */ +// Keep track of the used masternodes std::vector vecMasternodesUsed; -// keep track of the scanning errors I've seen +// Keep track of the scanning errors I've seen map mapDarksendBroadcastTxes; -// +// Keep track of the active masternode CActiveMasternode activeMasternode; -// count peers we've requested the list from +// Count peers we've requested the list from int RequestedMasterNodeList = 0; /* *** BEGIN DARKSEND MAGIC - DARKCOIN ********** - Copyright 2014, Darkcoin Developers + Copyright 2014-2015, Darkcoin Developers eduffield - evan@darkcoin.io udjinm6 - udjinm6@darkcoin.io */ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand, CDataStream& vRecv) { - if(fLiteMode) return; //disable all darksend/masternode related functionality + if(fLiteMode) return; //disable all Darksend/masternode related functionality if(IsInitialBlockDownload()) return; - if (strCommand == "dsa") { //DarkSend Accept Into Pool + if (strCommand == "dsa") { //Darksend Accept Into Pool if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) { std::string strError = _("Incompatible version."); @@ -102,7 +102,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand return; } - } else if (strCommand == "dsq") { //DarkSend Queue + } else if (strCommand == "dsq") { //Darksend Queue LOCK(cs_darksend); if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) { @@ -133,7 +133,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand //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()); + if (fDebug) LogPrintf("Darksend queue is ready - %s\n", addr.ToString().c_str()); PrepareDarksendDenominate(); } } else { @@ -152,13 +152,13 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand pmn->nLastDsq = nDsqCount; pmn->allowFreeTx = true; - if(fDebug) LogPrintf("dsq - new darksend queue object - %s\n", addr.ToString().c_str()); + if(fDebug) LogPrintf("dsq - new Darksend queue object - %s\n", addr.ToString().c_str()); vecDarksendQueue.push_back(dsq); dsq.Relay(); dsq.time = GetTime(); } - } else if (strCommand == "dsr") { //DarkSend Relay + } else if (strCommand == "dsr") { //Darksend Relay //* Ask a masternode to relay an anonymous output to another masternode *// @@ -219,7 +219,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand } } - } else if (strCommand == "dsai") { //DarkSend Anonymous Item (Input/Output/Sig) + } else if (strCommand == "dsai") { //Darksend Anonymous Item (Input/Output/Sig) std::string error = ""; if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) { @@ -287,7 +287,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand RelayStatus(sessionID, GetState(), GetEntriesCount(), MASTERNODE_ACCEPTED); Check(); - } else if (strCommand == "dsi") { //DarkSend vIn + } else if (strCommand == "dsi") { //Darksend vIn std::string error = ""; if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) { @@ -373,7 +373,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand } if (nValueIn > DARKSEND_POOL_MAX) { - LogPrintf("dsi -- more than darksend pool max! %s\n", tx.ToString().c_str()); + LogPrintf("dsi -- more than Darksend pool max! %s\n", tx.ToString().c_str()); error = _("Value more than Darksend pool maximum allows."); pfrom->PushMessage("dssu", sessionID, GetState(), GetEntriesCount(), MASTERNODE_REJECTED, error); return; @@ -410,7 +410,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand pfrom->PushMessage("dssu", sessionID, GetState(), GetEntriesCount(), MASTERNODE_REJECTED, error); } - } else if (strCommand == "dssu") { //DarkSend status update + } else if (strCommand == "dssu") { //Darksend status update if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) { return; @@ -432,13 +432,13 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand if(fDebug) LogPrintf("dssu - state: %i entriesCount: %i accepted: %i error: %s \n", state, entriesCount, accepted, error.c_str()); if((accepted != 1 && accepted != 0) && sessionID != sessionIDMessage){ - LogPrintf("dssu - message doesn't match current darksend session %d %d\n", sessionID, sessionIDMessage); + LogPrintf("dssu - message doesn't match current Darksend session %d %d\n", sessionID, sessionIDMessage); return; } StatusUpdate(state, entriesCount, accepted, error, sessionIDMessage); - } else if (strCommand == "dss") { //DarkSend Sign Final Tx + } else if (strCommand == "dss") { //Darksend Sign Final Tx if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) { return; @@ -463,7 +463,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand CheckFinalTransaction(); RelayStatus(sessionID, GetState(), GetEntriesCount(), MASTERNODE_RESET); } - } else if (strCommand == "dsf") { //DarkSend Final tx + } else if (strCommand == "dsf") { //Darksend Final tx if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) { return; } @@ -479,14 +479,14 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand vRecv >> sessionIDMessage >> txNew; if(sessionID != sessionIDMessage){ - if (fDebug) LogPrintf("dsf - message doesn't match current darksend session %d %d\n", sessionID, sessionIDMessage); + if (fDebug) LogPrintf("dsf - message doesn't match current Darksend session %d %d\n", sessionID, sessionIDMessage); return; } //check to see if input is spent already? (and probably not confirmed) SignFinalTransaction(txNew, pfrom); - } else if (strCommand == "dsc") { //DarkSend Complete + } else if (strCommand == "dsc") { //Darksend Complete if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) { return; @@ -504,7 +504,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand vRecv >> sessionIDMessage >> error >> lastMessage; if(sessionID != sessionIDMessage){ - if (fDebug) LogPrintf("dsc - message doesn't match current darksend session %d %d\n", darkSendPool.sessionID, sessionIDMessage); + if (fDebug) LogPrintf("dsc - message doesn't match current Darksend session %d %d\n", darkSendPool.sessionID, sessionIDMessage); return; } @@ -515,7 +515,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand int randomizeList (int i) { return std::rand()%i;} -// Recursively determine the rounds of a given input (How deep is the darksend chain for a given input) +// Recursively determine the rounds of a given input (How deep is the Darksend chain for a given input) int GetInputDarksendRounds(CTxIn in, int rounds) { static std::map mDenomWtxes; @@ -662,7 +662,7 @@ bool CDarksendPool::SetCollateralAddress(std::string strAddress){ CBitcoinAddress address; if (!address.SetString(strAddress)) { - LogPrintf("CDarksendPool::SetCollateralAddress - Invalid DarkSend collateral address\n"); + LogPrintf("CDarksendPool::SetCollateralAddress - Invalid Darksend collateral address\n"); return false; } collateralPubKey.SetDestination(address.Get()); @@ -843,7 +843,7 @@ void CDarksendPool::CheckFinalTransaction() // Charge clients a fee if they're abusive // // Why bother? Darksend uses collateral to ensure abuse to the process is kept to a minimum. -// The submission and signing stages in darksend are completely separate. In the cases where +// The submission and signing stages in Darksend are completely separate. In the cases where // a client submits a transaction then refused to sign, there must be a cost. Otherwise they // would be able to do this over and over again and bring the mixing to a hault. // @@ -965,7 +965,7 @@ void CDarksendPool::ChargeRandomFees(){ /* Collateral Fee Charges: - Being that DarkSend has "no fees" we need to have some kind of cost associated + Being that Darksend has "no fees" we need to have some kind of cost associated with using it to stop abuse. Otherwise it could serve as an attack vector and allow endless transaction that would bloat Darkcoin and make it unusable. To stop these kinds of attacks 1 in 10 successful transactions are charged. This @@ -990,7 +990,7 @@ void CDarksendPool::ChargeRandomFees(){ } // -// Check for various timeouts (queue objects, darksend, etc) +// Check for various timeouts (queue objects, Darksend, etc) // void CDarksendPool::CheckTimeout(){ if(!fEnableDarksend && !fMasterNode) return; @@ -1003,7 +1003,7 @@ void CDarksendPool::CheckTimeout(){ } } - // check darksend queue objects for timeouts + // check Darksend queue objects for timeouts int c = 0; vector::iterator it; for(it=vecDarksendQueue.begin();it& vin, std::vector& vout, int64_t amount){ @@ -1344,7 +1344,7 @@ void CDarksendPool::SendDarksendDenominate(std::vector& vin, std::vector< return; if(fMasterNode) { - LogPrintf("CDarksendPool::SendDarksendDenominate() - DarkSend from a masternode is not supported currently.\n"); + LogPrintf("CDarksendPool::SendDarksendDenominate() - Darksend from a masternode is not supported currently.\n"); return; } @@ -1391,7 +1391,7 @@ void CDarksendPool::SendDarksendDenominate(std::vector& vin, std::vector< Check(); } -// Incoming message from masternode updating the progress of darksend +// Incoming message from masternode updating the progress of Darksend // newAccepted: -1 mean's it'n not a "transaction accepted/not accepted" message, just a standard update // 0 means transaction was not accepted // 1 means transaction was accepted @@ -1538,7 +1538,7 @@ void CDarksendPool::NewBlock() } } -// Darksend transaction was completed (failed or successed) +// Darksend transaction was completed (failed or successful) void CDarksendPool::CompletedTransaction(bool error, std::string lastMessageNew) { if(fMasterNode) return; @@ -1584,8 +1584,8 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready) if(state == POOL_STATUS_ERROR || state == POOL_STATUS_SUCCESS) return false; if(chainActive.Tip()->nHeight - cachedLastSuccess < minBlockSpacing) { - LogPrintf("CDarksendPool::DoAutomaticDenominating - Last successful darksend action was too recent\n"); - strAutoDenomResult = _("Last successful darksend action was too recent."); + LogPrintf("CDarksendPool::DoAutomaticDenominating - Last successful Darksend action was too recent\n"); + strAutoDenomResult = _("Last successful Darksend action was too recent."); return false; } if(!fEnableDarksend) { @@ -1833,7 +1833,7 @@ bool CDarksendPool::PrepareDarksendDenominate() { // Submit transaction to the pool if we get here, use sessionDenom so we use the same amount of money std::string strError = pwalletMain->PrepareDarksendDenominate(0, nDarksendRounds); - LogPrintf("DoAutomaticDenominating : Running darksend denominate. Return '%s'\n", strError.c_str()); + LogPrintf("DoAutomaticDenominating : Running Darksend denominate. Return '%s'\n", strError.c_str()); if(strError == "") return true; @@ -2484,7 +2484,7 @@ bool CDSAnonTx::AddSig(const CTxIn newIn){ //TODO: Rename/move to core void ThreadCheckDarkSendPool() { - if(fLiteMode) return; //disable all darksend/masternode related functionality + if(fLiteMode) return; //disable all Darksend/masternode related functionality // Make this thread recognisable as the wallet flushing thread RenameThread("darkcoin-darksend"); diff --git a/src/darksend.h b/src/darksend.h index a7b3a6d2eb..2682e01758 100644 --- a/src/darksend.h +++ b/src/darksend.h @@ -38,9 +38,9 @@ class CActiveMasternode; #define MASTERNODE_REJECTED 0 #define MASTERNODE_RESET -1 -#define DARKSEND_QUEUE_TIMEOUT 120 -#define DARKSEND_SIGNING_TIMEOUT 30 -#define DARKSEND_DOWNGRADE_TIMEOUT 30 +#define DARKSEND_QUEUE_TIMEOUT 120 // in seconds +#define DARKSEND_SIGNING_TIMEOUT 30 // in seconds +#define DARKSEND_DOWNGRADE_TIMEOUT 30 // in seconds // used for anonymous relaying of inputs/outputs/sigs #define DARKSEND_RELAY_IN 1 @@ -54,13 +54,11 @@ extern std::string strMasterNodePrivKey; extern map mapDarksendBroadcastTxes; extern CActiveMasternode activeMasternode; -// get the darksend chain depth for a given input +// get the Darksend chain depth for a given input int GetInputDarksendRounds(CTxIn in, int rounds=0); -// -// Holds an Darksend input -// - +/** Holds an Darksend input + */ class CTxDSIn : public CTxIn { public: @@ -76,8 +74,9 @@ 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 + * -- holds the input/output mapping for each user in the pool + */ class CDarkSendEntry { public: @@ -96,6 +95,7 @@ public: amount = 0; } + /// Add entries to use for Darksend bool Add(const std::vector vinIn, int64_t amountIn, const CTransaction collateralIn, const std::vector voutIn) { if(isSet){return false;} @@ -110,6 +110,7 @@ public: return true; } + /// Is this Darksend expired? bool IsExpired() { return (GetTime() - addedTime) > DARKSEND_QUEUE_TIMEOUT;// 120 seconds @@ -117,9 +118,9 @@ public: }; -// -// A currently inprogress darksend merge and denomination information -// +/** + * A currently inprogress Darksend merge and denomination information + */ class CDarksendQueue { public: @@ -183,19 +184,30 @@ public: return false; } + /** Sign this Darksend transaction + * \return true if all conditions are met: + * 1) we have an active MasterNode, + * 2) we have a valid MasterNode private key, + * 3) we signed the message successfully, and + * 4) we verified the message successfully + */ bool Sign(); + bool Relay(); + /// Is this Darksend expired? bool IsExpired() { return (GetTime() - time) > DARKSEND_QUEUE_TIMEOUT;// 120 seconds } + /// Check if we have a valid MasterNode address bool CheckSignature(); }; -// store darksend tx signature information +/** Helper class to store Darksend transaction (tx) information. + */ class CDarksendBroadcastTx { public: @@ -205,9 +217,8 @@ public: int64_t sigTime; }; -// -// Helper object for signing and checking signatures -// +/** Helper object for signing and checking signatures + */ class CDarkSendSigner { public: @@ -217,9 +228,8 @@ public: bool VerifyMessage(CPubKey pubkey, std::vector& vchSig, std::string strMessage, std::string& errorMessage); }; -// -// Build a transaction anonymously -// +/** Build a transaction anonymously + */ class CDSAnonTx { public: @@ -229,6 +239,8 @@ public: bool IsTransactionValid(); bool AddOutput(const CTxOut out); bool AddInput(const CTxIn in); + + /// Add Signature bool AddSig(const CTxIn in); int CountEntries() {return (int)vin.size() + (int)vout.size();} }; @@ -236,9 +248,8 @@ public: void ConnectToDarkSendMasterNodeWinner(); -// -// Used to keep track of current status of darksend pool -// +/** Used to keep track of current status of Darksend pool + */ class CDarksendPool { public: @@ -254,8 +265,8 @@ public: bool fSubmitAnonymousFailed; int nCountAttempts; - int64_t lastTimeChanged; - int64_t lastAutoDenomination; + int64_t lastTimeChanged; // time in UTC milliseconds + int64_t lastAutoDenomination; // Note: possibly not used TODO: Delete? unsigned int state; unsigned int entriesCount; @@ -302,7 +313,7 @@ public: CDarksendPool() { - /* DarkSend uses collateral addresses to trust parties entering the pool + /* Darksend uses collateral addresses to trust parties entering the pool to behave themselves. If they don't it takes their money. */ cachedLastSuccess = 0; @@ -318,7 +329,21 @@ public: SetNull(); } - //specific messages for the Darksend protocol + /** Process a Darksend message using the Darksend protocol + * \param pfrom + * \param strCommand lower case command string; valid values are: + * Command | Description + * -------- | ----------------- + * dsa | Darksend Acceptable + * dsc | Darksend Complete + * dsf | Darksend Final tx + * dsi | Darksend vIn + * dsq | Darksend Queue + * dss | Darksend Signal Final Tx + * dssu | Darksend status update + * dssub | Darksend Subscribe To + * \param vRecv + */ void ProcessMessageDarksend(CNode* pfrom, std::string& strCommand, CDataStream& vRecv); void InitCollateralAddress(){ @@ -404,38 +429,38 @@ public: return POOL_MAX_TRANSACTIONS; } - //Do we have enough users to take entries? + /// Do we have enough users to take entries? bool IsSessionReady(){ return sessionUsers >= GetMaxPoolTransactions(); } - // Are these outputs compatible with other client in the pool? + /// Are these outputs compatible with other client in the pool? bool IsCompatibleWithEntries(std::vector& vout); - // Is this amount compatible with other client in the pool? + /// Is this amount compatible with other client in the pool? bool IsCompatibleWithSession(int64_t nAmount, CTransaction txCollateral, std::string& strReason); - // Passively run Darksend in the background according to the configuration in settings (only for QT) + /// Passively run Darksend in the background according to the configuration in settings (only for QT) bool DoAutomaticDenominating(bool fDryRun=false, bool ready=false); bool PrepareDarksendDenominate(); - // check for process in Darksend + /// Check for process in Darksend void Check(); void CheckFinalTransaction(); - // charge fees to bad actors + /// Charge fees to bad actors (Charge clients a fee if they're abusive) void ChargeFees(); - // rarely charge fees to pay miners + /// Rarely charge fees to pay miners void ChargeRandomFees(); void CheckTimeout(); void CheckForCompleteQueue(); - // check to make sure a signature matches an input in the pool + /// Check to make sure a signature matches an input in the pool bool SignatureValid(const CScript& newSig, const CTxIn& newVin); - // if the collateral is valid given by a client + /// If the collateral is valid given by a client bool IsCollateralValid(const CTransaction& txCollateral); - // add a clients entry to the pool + /// 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 + /// 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);} @@ -446,36 +471,36 @@ public: return true; } - // add signature to a vin + /// Add signature to a vin bool AddScriptSig(const CTxIn& newVin); - // are all inputs signed? + /// Check that all inputs are signed. (Are all inputs signed?) bool SignaturesComplete(); - // as a client, send a transaction to a masternode to start the denomination process + /// As a client, send a transaction to a masternode to start the denomination process void SendDarksendDenominate(std::vector& vin, std::vector& vout, int64_t amount); - // get masternode updates about the progress of darksend + /// Get masternode updates about the progress of Darksend bool StatusUpdate(int newState, int newEntriesCount, int newAccepted, std::string& error, int newSessionID=0); - // as a client, check and sign the final transaction + /// As a client, check and sign the final transaction bool SignFinalTransaction(CTransaction& finalTransactionNew, CNode* node); - // get the last valid block hash for a given modulus + /// Get the last valid block hash for a given modulus bool GetLastValidBlockHash(uint256& hash, int mod=1, int nBlockHeight=0); - // process a new block + /// Process a new block void NewBlock(); void CompletedTransaction(bool error, std::string lastMessageNew); void ClearLastMessage(); - // used for liquidity providers + /// Used for liquidity providers bool SendRandomPaymentToSelf(); - // split up large inputs or make fee sized inputs + /// Split up large inputs or make fee sized inputs bool MakeCollateralAmounts(); bool CreateDenominated(int64_t nTotalValue); - // get the denominations for a list of outputs (returns a bitshifted integer) + /// Get the denominations for a list of outputs (returns a bitshifted integer) int GetDenominations(const std::vector& vout); void GetDenominationsToString(int nDenom, std::string& strDenom); - // get the denominations for a specific amount of darkcoin. + /// Get the denominations for a specific amount of darkcoin. int GetDenominationsByAmount(int64_t nAmount, int nDenomTarget=0); int GetDenominationsByAmounts(std::vector& vecAmount); diff --git a/src/util.h b/src/util.h index c11176911d..9b341bd1e4 100644 --- a/src/util.h +++ b/src/util.h @@ -326,12 +326,14 @@ inline int64_t GetPerformanceCounter() return nCounter; } +/// returns the current time as UTC milliseconds inline int64_t GetTimeMillis() { return (boost::posix_time::ptime(boost::posix_time::microsec_clock::universal_time()) - boost::posix_time::ptime(boost::gregorian::date(1970,1,1))).total_milliseconds(); } +/// returns the current time as UTC microseconds inline int64_t GetTimeMicros() { return (boost::posix_time::ptime(boost::posix_time::microsec_clock::universal_time()) - From 98fe439af4dad40d6861f2e97dfe1999b9f9e05a Mon Sep 17 00:00:00 2001 From: Mike Kinney Date: Thu, 5 Mar 2015 00:10:15 -0800 Subject: [PATCH 2/3] V0.11.2.x update comments --- src/activemasternode.cpp | 30 +++++------ src/activemasternode.h | 34 +++++++----- src/darksend.cpp | 110 +++++++++++++++++++-------------------- src/darksend.h | 16 +++--- src/masternode.h | 2 +- src/masternodeman.cpp | 60 ++++++++++----------- src/masternodeman.h | 28 +++++----- 7 files changed, 144 insertions(+), 136 deletions(-) diff --git a/src/activemasternode.cpp b/src/activemasternode.cpp index 30d9de8b75..bed502b693 100644 --- a/src/activemasternode.cpp +++ b/src/activemasternode.cpp @@ -6,7 +6,7 @@ #include // -// Bootup the masternode, look for a 1000DRK input and register on the network +// Bootup the Masternode, look for a 1000DRK input and register on the network // void CActiveMasternode::ManageStatus() { @@ -20,7 +20,7 @@ void CActiveMasternode::ManageStatus() bool fIsInitialDownload = IsInitialBlockDownload(); if(fIsInitialDownload) { status = MASTERNODE_SYNC_IN_PROCESS; - LogPrintf("CActiveMasternode::ManageStatus() - Sync in progress. Must wait until sync is complete to start masternode.\n"); + LogPrintf("CActiveMasternode::ManageStatus() - Sync in progress. Must wait until sync is complete to start Masternode.\n"); return; } @@ -31,7 +31,7 @@ void CActiveMasternode::ManageStatus() if(status == MASTERNODE_NOT_PROCESSED) { if(strMasterNodeAddr.empty()) { if(!GetLocal(service)) { - notCapableReason = "Can't detect external address. Please use the masternodeaddr configuration option."; + notCapableReason = "Can't detect external address. Please use the Masternodeaddr configuration option."; status = MASTERNODE_NOT_CAPABLE; LogPrintf("CActiveMasternode::ManageStatus() - not capable: %s\n", notCapableReason.c_str()); return; @@ -119,7 +119,7 @@ void CActiveMasternode::ManageStatus() } } -// Send stop dseep to network for remote masternode +// Send stop dseep to network for remote Masternode bool CActiveMasternode::StopMasterNode(std::string strService, std::string strKeyMasternode, std::string& errorMessage) { CTxIn vin; CKey keyMasternode; @@ -133,10 +133,10 @@ bool CActiveMasternode::StopMasterNode(std::string strService, std::string strKe return StopMasterNode(vin, CService(strService), keyMasternode, pubKeyMasternode, errorMessage); } -// Send stop dseep to network for main masternode +// Send stop dseep to network for main Masternode bool CActiveMasternode::StopMasterNode(std::string& errorMessage) { if(status != MASTERNODE_IS_CAPABLE && status != MASTERNODE_REMOTELY_ENABLED) { - errorMessage = "masternode is not in a running status"; + errorMessage = "Masternode is not in a running status"; LogPrintf("CActiveMasternode::StopMasterNode() - Error: %s\n", errorMessage.c_str()); return false; } @@ -155,7 +155,7 @@ bool CActiveMasternode::StopMasterNode(std::string& errorMessage) { return StopMasterNode(vin, service, keyMasternode, pubKeyMasternode, errorMessage); } -// Send stop dseep to network for any masternode +// Send stop dseep to network for any Masternode bool CActiveMasternode::StopMasterNode(CTxIn vin, CService service, CKey keyMasternode, CPubKey pubKeyMasternode, std::string& errorMessage) { pwalletMain->UnlockCoin(vin.prevout); return Dseep(vin, service, keyMasternode, pubKeyMasternode, errorMessage, true); @@ -163,7 +163,7 @@ bool CActiveMasternode::StopMasterNode(CTxIn vin, CService service, CKey keyMast bool CActiveMasternode::Dseep(std::string& errorMessage) { if(status != MASTERNODE_IS_CAPABLE && status != MASTERNODE_REMOTELY_ENABLED) { - errorMessage = "masternode is not in a running status"; + errorMessage = "Masternode is not in a running status"; LogPrintf("CActiveMasternode::Dseep() - Error: %s\n", errorMessage.c_str()); return false; } @@ -200,7 +200,7 @@ bool CActiveMasternode::Dseep(CTxIn vin, CService service, CKey keyMasternode, C return false; } - // Update Last Seen timestamp in masternode list + // Update Last Seen timestamp in Masternode list CMasternode* pmn = mnodeman.Find(vin); if(pmn != NULL) { @@ -208,8 +208,8 @@ bool CActiveMasternode::Dseep(CTxIn vin, CService service, CKey keyMasternode, C } else { - // Seems like we are trying to send a ping while the masternode is not registered in the network - retErrorMessage = "Darksend Masternode List doesn't include our masternode, Shutting down masternode pinging service! " + vin.ToString(); + // Seems like we are trying to send a ping while the Masternode is not registered in the network + retErrorMessage = "Darksend Masternode List doesn't include our Masternode, Shutting down Masternode pinging service! " + vin.ToString(); LogPrintf("CActiveMasternode::Dseep() - Error: %s\n", retErrorMessage.c_str()); status = MASTERNODE_NOT_CAPABLE; notCapableReason = retErrorMessage; @@ -270,7 +270,7 @@ bool CActiveMasternode::Register(CTxIn vin, CService service, CKey keyCollateral CMasternode* pmn = mnodeman.Find(vin); if(pmn == NULL) { - LogPrintf("CActiveMasternode::Register() - Adding to masternode list service: %s - vin: %s\n", service.ToString().c_str(), vin.ToString().c_str()); + LogPrintf("CActiveMasternode::Register() - Adding to Masternode list service: %s - vin: %s\n", service.ToString().c_str(), vin.ToString().c_str()); CMasternode mn(service, vin, pubKeyCollateralAddress, vchMasterNodeSignature, masterNodeSignatureTime, pubKeyMasternode, PROTOCOL_VERSION); mn.UpdateLastSeen(masterNodeSignatureTime); mnodeman.Add(mn); @@ -327,7 +327,7 @@ bool CActiveMasternode::GetMasterNodeVin(CTxIn& vin, CPubKey& pubkey, CKey& secr } -// Extract masternode vin information from output +// Extract Masternode vin information from output bool CActiveMasternode::GetVinFromOutput(COutput out, CTxIn& vin, CPubKey& pubkey, CKey& secretKey) { CScript pubScript; @@ -354,7 +354,7 @@ bool CActiveMasternode::GetVinFromOutput(COutput out, CTxIn& vin, CPubKey& pubke return true; } -// get all possible outputs for running masternode +// get all possible outputs for running Masternode vector CActiveMasternode::SelectCoinsMasternode() { vector vCoins; @@ -373,7 +373,7 @@ vector CActiveMasternode::SelectCoinsMasternode() return filteredCoins; } -// when starting a masternode, this can enable to run as a hot wallet with no funds +// when starting a Masternode, this can enable to run as a hot wallet with no funds bool CActiveMasternode::EnableHotColdMasterNode(CTxIn& newVin, CService& newService) { if(!fMasterNode) return false; diff --git a/src/activemasternode.h b/src/activemasternode.h index abecfe95f7..eba0e6da7b 100644 --- a/src/activemasternode.h +++ b/src/activemasternode.h @@ -14,15 +14,15 @@ #include "wallet.h" #include "darksend.h" -// Responsible for activating the masternode and pinging the network +// Responsible for activating the Masternode and pinging the network class CActiveMasternode { public: // Initialized by init.cpp - // Keys for the main masternode + // Keys for the main Masternode CPubKey pubKeyMasternode; - // Initialized while registering masternode + // Initialized while registering Masternode CTxIn vin; CService service; @@ -34,25 +34,33 @@ public: status = MASTERNODE_NOT_PROCESSED; } - void ManageStatus(); // manage status of main masternode + /// Manage status of main Masternode + void ManageStatus(); - bool Dseep(std::string& errorMessage); // ping for main masternode - bool Dseep(CTxIn vin, CService service, CKey key, CPubKey pubKey, std::string &retErrorMessage, bool stop); // ping for any masternode + /// Ping for main Masternode + bool Dseep(std::string& errorMessage); + /// Ping for any Masternode + bool Dseep(CTxIn vin, CService service, CKey key, CPubKey pubKey, std::string &retErrorMessage, bool stop); - bool StopMasterNode(std::string& errorMessage); // stop main masternode - bool StopMasterNode(std::string strService, std::string strKeyMasternode, std::string& errorMessage); // stop remote masternode - bool StopMasterNode(CTxIn vin, CService service, CKey key, CPubKey pubKey, std::string& errorMessage); // stop any masternode + /// Stop main Masternode + bool StopMasterNode(std::string& errorMessage); + /// Stop remote Masternode + bool StopMasterNode(std::string strService, std::string strKeyMasternode, std::string& errorMessage); + /// Stop any Masternode + bool StopMasterNode(CTxIn vin, CService service, CKey key, CPubKey pubKey, std::string& errorMessage); - bool Register(std::string strService, std::string strKey, std::string txHash, std::string strOutputIndex, std::string& errorMessage); // register remote masternode - bool Register(CTxIn vin, CService service, CKey key, CPubKey pubKey, CKey keyMasternode, CPubKey pubKeyMasternode, std::string &retErrorMessage); // register any masternode + /// Register remote Masternode + bool Register(std::string strService, std::string strKey, std::string txHash, std::string strOutputIndex, std::string& errorMessage); + /// Register any Masternode + bool Register(CTxIn vin, CService service, CKey key, CPubKey pubKey, CKey keyMasternode, CPubKey pubKeyMasternode, std::string &retErrorMessage); - // get 1000DRK input that can be used for the masternode + /// Get 1000DRK input that can be used for the Masternode bool GetMasterNodeVin(CTxIn& vin, CPubKey& pubkey, CKey& secretKey); bool GetMasterNodeVin(CTxIn& vin, CPubKey& pubkey, CKey& secretKey, std::string strTxHash, std::string strOutputIndex); vector SelectCoinsMasternode(); bool GetVinFromOutput(COutput out, CTxIn& vin, CPubKey& pubkey, CKey& secretKey); - // enable hot wallet mode (run a masternode with no funds) + /// Enable hot wallet mode (run a Masternode with no funds) bool EnableHotColdMasterNode(CTxIn& vin, CService& addr); }; diff --git a/src/darksend.cpp b/src/darksend.cpp index 5aa049035c..8e1f798101 100644 --- a/src/darksend.cpp +++ b/src/darksend.cpp @@ -25,15 +25,15 @@ CCriticalSection cs_darksend; // The main object for accessing Darksend CDarksendPool darkSendPool; -// A helper object for signing messages from masternodes +// A helper object for signing messages from Masternodes CDarkSendSigner darkSendSigner; // The current Darksends in progress on the network std::vector vecDarksendQueue; -// Keep track of the used masternodes +// Keep track of the used Masternodes std::vector vecMasternodesUsed; // Keep track of the scanning errors I've seen map mapDarksendBroadcastTxes; -// Keep track of the active masternode +// Keep track of the active Masternode CActiveMasternode activeMasternode; // Count peers we've requested the list from @@ -47,7 +47,7 @@ int RequestedMasterNodeList = 0; void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand, CDataStream& vRecv) { - if(fLiteMode) return; //disable all Darksend/masternode related functionality + if(fLiteMode) return; //disable all Darksend/Masternode related functionality if(IsInitialBlockDownload()) return; if (strCommand == "dsa") { //Darksend Accept Into Pool @@ -61,8 +61,8 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand } if(!fMasterNode){ - std::string strError = _("This is not a masternode."); - LogPrintf("dsa -- not a masternode! \n"); + std::string strError = _("This is not a Masternode."); + LogPrintf("dsa -- not a Masternode! \n"); pfrom->PushMessage("dssu", sessionID, GetState(), GetEntriesCount(), MASTERNODE_REJECTED, strError); return; @@ -76,7 +76,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand CMasternode* pmn = mnodeman.Find(activeMasternode.vin); if(pmn == NULL) { - std::string strError = _("Not in the masternode list."); + std::string strError = _("Not in the Masternode list."); pfrom->PushMessage("dssu", sessionID, GetState(), GetEntriesCount(), MASTERNODE_REJECTED, strError); return; } @@ -125,7 +125,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand if(dsq.ready) { if(!pSubmittedToMasternode) return; if((CNetAddr)pSubmittedToMasternode->addr != (CNetAddr)addr){ - LogPrintf("dsq - message doesn't match current masternode - %s != %s\n", pSubmittedToMasternode->addr.ToString().c_str(), addr.ToString().c_str()); + LogPrintf("dsq - message doesn't match current Masternode - %s != %s\n", pSubmittedToMasternode->addr.ToString().c_str(), addr.ToString().c_str()); return; } @@ -145,7 +145,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand //don't allow a few nodes to dominate the queuing process if(pmn->nLastDsq != 0 && pmn->nLastDsq + mnodeman.CountMasternodesAboveProtocol(MIN_POOL_PEER_PROTO_VERSION)/5 > nDsqCount){ - if(fDebug) LogPrintf("dsq -- masternode sending too many dsq messages. %s \n", pmn->addr.ToString().c_str()); + if(fDebug) LogPrintf("dsq -- Masternode sending too many dsq messages. %s \n", pmn->addr.ToString().c_str()); return; } nDsqCount++; @@ -160,7 +160,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand } else if (strCommand == "dsr") { //Darksend Relay - //* Ask a masternode to relay an anonymous output to another masternode *// + //* Ask a Masternode to relay an anonymous output to another Masternode *// std::string error = ""; if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) { @@ -169,7 +169,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand } if(!fMasterNode){ - LogPrintf("dsr -- not a masternode! \n"); + LogPrintf("dsr -- not a Masternode! \n"); return; } @@ -189,22 +189,22 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand CMasternode* pmn = mnodeman.Find(dsr.vinMasternode); if(!pmn){ - LogPrintf("dsr -- unknown masternode! %s \n", dsr.vinMasternode.ToString().c_str()); + LogPrintf("dsr -- unknown Masternode! %s \n", dsr.vinMasternode.ToString().c_str()); return; } int a = mnodeman.GetMasternodeRank(activeMasternode.vin, chainActive.Tip()->nHeight, MIN_POOL_PEER_PROTO_VERSION); if(a > 20){ - LogPrintf("dsr -- unknown/invalid masternode! %s \n", activeMasternode.vin.ToString().c_str()); + LogPrintf("dsr -- unknown/invalid Masternode! %s \n", activeMasternode.vin.ToString().c_str()); return; } - //check the signature from the target masternode + //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"); + LogPrintf("dsr - Got bad Masternode address signature\n"); Misbehaving(pfrom->GetId(), 100); return; } @@ -228,7 +228,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand } if(!fMasterNode){ - LogPrintf("dsai -- not a masternode! \n"); + LogPrintf("dsai -- not a Masternode! \n"); return; } @@ -246,15 +246,15 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand CMasternode* pmn = mnodeman.Find(dsr.vinMasternode); if(!pmn){ - LogPrintf("dsr -- unknown masternode! %s \n", dsr.vinMasternode.ToString().c_str()); + LogPrintf("dsr -- unknown Masternode! %s \n", dsr.vinMasternode.ToString().c_str()); return; } - //check the signature from the target masternode + //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"); + LogPrintf("dsr - Got bad Masternode address signature\n"); Misbehaving(pfrom->GetId(), 100); return; } @@ -299,8 +299,8 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand } if(!fMasterNode){ - LogPrintf("dsi -- not a masternode! \n"); - error = _("This is not a masternode."); + LogPrintf("dsi -- not a Masternode! \n"); + error = _("This is not a Masternode."); pfrom->PushMessage("dssu", sessionID, GetState(), GetEntriesCount(), MASTERNODE_REJECTED, error); return; @@ -418,7 +418,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand if(!pSubmittedToMasternode) return; if((CNetAddr)pSubmittedToMasternode->addr != (CNetAddr)pfrom->addr){ - //LogPrintf("dssu - message doesn't match current masternode - %s != %s\n", pSubmittedToMasternode->addr.ToString().c_str(), pfrom->addr.ToString().c_str()); + //LogPrintf("dssu - message doesn't match current Masternode - %s != %s\n", pSubmittedToMasternode->addr.ToString().c_str(), pfrom->addr.ToString().c_str()); return; } @@ -470,7 +470,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand if(!pSubmittedToMasternode) return; if((CNetAddr)pSubmittedToMasternode->addr != (CNetAddr)pfrom->addr){ - //LogPrintf("dsc - message doesn't match current masternode - %s != %s\n", pSubmittedToMasternode->addr.ToString().c_str(), pfrom->addr.ToString().c_str()); + //LogPrintf("dsc - message doesn't match current Masternode - %s != %s\n", pSubmittedToMasternode->addr.ToString().c_str(), pfrom->addr.ToString().c_str()); return; } @@ -494,7 +494,7 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand if(!pSubmittedToMasternode) return; if((CNetAddr)pSubmittedToMasternode->addr != (CNetAddr)pfrom->addr){ - //LogPrintf("dsc - message doesn't match current masternode - %s != %s\n", pSubmittedToMasternode->addr.ToString().c_str(), pfrom->addr.ToString().c_str()); + //LogPrintf("dsc - message doesn't match current Masternode - %s != %s\n", pSubmittedToMasternode->addr.ToString().c_str(), pfrom->addr.ToString().c_str()); return; } @@ -680,7 +680,7 @@ void CDarksendPool::UnlockCoins(){ } // -// Check the Darksend progress and send client updates if a masternode +// Check the Darksend progress and send client updates if a Masternode // void CDarksendPool::Check() { @@ -795,7 +795,7 @@ void CDarksendPool::CheckFinalTransaction() if(!darkSendSigner.SetKey(strMasterNodePrivKey, strError, key2, pubkey2)) { - LogPrintf("CDarksendPool::Check() - ERROR: Invalid masternodeprivkey: '%s'\n", strError.c_str()); + LogPrintf("CDarksendPool::Check() - ERROR: Invalid Masternodeprivkey: '%s'\n", strError.c_str()); return; } @@ -847,8 +847,8 @@ void CDarksendPool::CheckFinalTransaction() // a client submits a transaction then refused to sign, there must be a cost. Otherwise they // would be able to do this over and over again and bring the mixing to a hault. // -// How does this work? Messages to masternodes come in via "dsi", these require a valid collateral -// transaction for the client to be able to enter the pool. This transaction is kept by the masternode +// How does this work? Messages to Masternodes come in via "dsi", these require a valid collateral +// transaction for the client to be able to enter the pool. This transaction is kept by the Masternode // until the transaction is either complete or fails. // void CDarksendPool::ChargeFees(){ @@ -1021,7 +1021,7 @@ void CDarksendPool::CheckTimeout(){ if(state == POOL_STATUS_ACCEPTING_ENTRIES || state == POOL_STATUS_QUEUE){ c = 0; - // if it's a masternode, the entries are stored in "entries", otherwise they're stored in myEntries + // if it's a Masternode, the entries are stored in "entries", otherwise they're stored in myEntries std::vector *vec = &myEntries; if(fMasterNode) vec = &entries; @@ -1054,7 +1054,7 @@ void CDarksendPool::CheckTimeout(){ 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) + // 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; @@ -1312,7 +1312,7 @@ bool CDarksendPool::SignaturesComplete(){ } // -// Execute a Darksend denomination via a masternode. +// Execute a Darksend denomination via a Masternode. // This is only ran from clients // void CDarksendPool::SendDarksendDenominate(std::vector& vin, std::vector& vout, int64_t amount){ @@ -1332,9 +1332,9 @@ void CDarksendPool::SendDarksendDenominate(std::vector& vin, std::vector< // LogPrintf(" vout - %s\n", o.ToString().c_str()); - // we should already be connected to a masternode + // we should already be connected to a Masternode if(!sessionFoundMasternode){ - LogPrintf("CDarksendPool::SendDarksendDenominate() - No masternode has been selected yet.\n"); + LogPrintf("CDarksendPool::SendDarksendDenominate() - No Masternode has been selected yet.\n"); UnlockCoins(); SetNull(true); return; @@ -1344,7 +1344,7 @@ void CDarksendPool::SendDarksendDenominate(std::vector& vin, std::vector< return; if(fMasterNode) { - LogPrintf("CDarksendPool::SendDarksendDenominate() - Darksend from a masternode is not supported currently.\n"); + LogPrintf("CDarksendPool::SendDarksendDenominate() - Darksend from a Masternode is not supported currently.\n"); return; } @@ -1391,7 +1391,7 @@ void CDarksendPool::SendDarksendDenominate(std::vector& vin, std::vector< Check(); } -// Incoming message from masternode updating the progress of Darksend +// Incoming message from Masternode updating the progress of Darksend // newAccepted: -1 mean's it'n not a "transaction accepted/not accepted" message, just a standard update // 0 means transaction was not accepted // 1 means transaction was accepted @@ -1428,10 +1428,10 @@ bool CDarksendPool::StatusUpdate(int newState, int newEntriesCount, int newAccep UpdateState(POOL_STATUS_QUEUE); printf("Updated 1\n"); } else if (newAccepted == 0 && sessionID == 0 && !sessionFoundMasternode) { - LogPrintf("CDarksendPool::StatusUpdate - entry not accepted by masternode \n"); + LogPrintf("CDarksendPool::StatusUpdate - entry not accepted by Masternode \n"); UnlockCoins(); UpdateState(POOL_STATUS_ACCEPTING_ENTRIES); - DoAutomaticDenominating(); //try another masternode + DoAutomaticDenominating(); //try another Masternode } if(sessionFoundMasternode) return true; } @@ -1440,7 +1440,7 @@ bool CDarksendPool::StatusUpdate(int newState, int newEntriesCount, int newAccep } // -// After we receive the finalized transaction from the masternode, we must +// After we receive the finalized transaction from the Masternode, we must // check it to make sure it's what we want, then sign it if we agree. // If we refuse to sign, it's possible we'll be charged collateral // @@ -1512,7 +1512,7 @@ bool CDarksendPool::SignFinalTransaction(CTransaction& finalTransactionNew, CNod if(!fSubmitAnonymousFailed){ RelaySignaturesAnon(sigs); } else { - // push all of our signatures to the masternode + // push all of our signatures to the Masternode if(sigs.size() > 0 && node != NULL) node->PushMessage("dss", sigs); } @@ -1606,8 +1606,8 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready) } if(mnodeman.size() == 0){ - if(fDebug) LogPrintf("CDarksendPool::DoAutomaticDenominating - No masternodes detected\n"); - strAutoDenomResult = _("No masternodes detected."); + if(fDebug) LogPrintf("CDarksendPool::DoAutomaticDenominating - No Masternodes detected\n"); + strAutoDenomResult = _("No Masternodes detected."); return false; } @@ -1671,7 +1671,7 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready) std::vector vOut; - // initial phase, find a masternode + // initial phase, find a Masternode if(!sessionFoundMasternode){ int nUseQueue = rand()%100; @@ -1707,7 +1707,7 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready) //non-denom's are incompatible if((dsq.nDenom & (1 << 4))) continue; - //don't reuse masternodes + //don't reuse Masternodes BOOST_FOREACH(CTxIn usedVin, vecMasternodesUsed){ if(dsq.vin == usedVin) { continue; @@ -1720,7 +1720,7 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready) continue; } - // connect to masternode and submit the queue request + // connect to Masternode and submit the queue request if(ConnectNode((CAddress)addr, NULL, true)){ CNode* pNode = FindNode(addr); if(pNode) @@ -1744,7 +1744,7 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready) } } else { LogPrintf("DoAutomaticDenominating --- error connecting \n"); - strAutoDenomResult = _("Error connecting to masternode."); + strAutoDenomResult = _("Error connecting to Masternode."); return DoAutomaticDenominating(); } @@ -1760,10 +1760,10 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready) CMasternode* pmn = mnodeman.FindRandom(); if(pmn == NULL) { - LogPrintf("DoAutomaticDenominating --- masternode list is empty!\n"); + LogPrintf("DoAutomaticDenominating --- Masternode list is empty!\n"); return false; } - //don't reuse masternodes + //don't reuse Masternodes BOOST_FOREACH(CTxIn usedVin, vecMasternodesUsed) { if(pmn->vin == usedVin){ i++; @@ -1782,7 +1782,7 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready) } lastTimeChanged = GetTimeMillis(); - LogPrintf("DoAutomaticDenominating -- attempt %d connection to masternode %s\n", i, pmn->addr.ToString().c_str()); + LogPrintf("DoAutomaticDenominating -- attempt %d connection to Masternode %s\n", i, pmn->addr.ToString().c_str()); if(ConnectNode((CAddress)pmn->addr, NULL, true)){ LOCK(cs_vNodes); @@ -1816,7 +1816,7 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun, bool ready) } } - strAutoDenomResult = _("No compatible masternode found."); + strAutoDenomResult = _("No compatible Masternode found."); return false; } @@ -2295,7 +2295,7 @@ bool CDarksendQueue::Sign() if(!darkSendSigner.SetKey(strMasterNodePrivKey, errorMessage, key2, pubkey2)) { - LogPrintf("CDarksendQueue():Relay - ERROR: Invalid masternodeprivkey: '%s'\n", errorMessage.c_str()); + LogPrintf("CDarksendQueue():Relay - ERROR: Invalid Masternodeprivkey: '%s'\n", errorMessage.c_str()); return false; } @@ -2354,7 +2354,7 @@ bool CDarksendQueue::CheckSignature() std::string errorMessage = ""; if(!darkSendSigner.VerifyMessage(pmn->pubkey2, vchSig, strMessage, errorMessage)){ - return error("CDarksendQueue::CheckSignature() - Got bad masternode address signature %s \n", vin.ToString().c_str()); + 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 @@ -2484,7 +2484,7 @@ bool CDSAnonTx::AddSig(const CTxIn newIn){ //TODO: Rename/move to core void ThreadCheckDarkSendPool() { - if(fLiteMode) return; //disable all Darksend/masternode related functionality + if(fLiteMode) return; //disable all Darksend/Masternode related functionality // Make this thread recognisable as the wallet flushing thread RenameThread("darkcoin-darksend"); @@ -2521,7 +2521,7 @@ void ThreadCheckDarkSendPool() if(c % MASTERNODES_DUMP_SECONDS == 0) DumpMasternodes(); - //try to sync the masternode list and payment list every 5 seconds from at least 3 nodes + //try to sync the Masternode list and payment list every 5 seconds from at least 3 nodes if(c % 5 == 0 && RequestedMasterNodeList < 3){ bool fIsInitialDownload = IsInitialBlockDownload(); if(!fIsInitialDownload) { @@ -2536,7 +2536,7 @@ void ThreadCheckDarkSendPool() LogPrintf("Successfully synced, asking for Masternode list and payment list\n"); - //request full mn list only if masternodes.dat was updated quite a long time ago + //request full mn list only if Masternodes.dat was updated quite a long time ago mnodeman.DsegUpdate(pnode); pnode->PushMessage("mnget"); //sync payees @@ -2548,7 +2548,7 @@ void ThreadCheckDarkSendPool() } if(c % 60 == 0){ - //if we've used 1/5 of the masternode list, then clear the list. + //if we've used 1/5 of the Masternode list, then clear the list. if((int)vecMasternodesUsed.size() > (int)mnodeman.size() / 5) vecMasternodesUsed.clear(); } diff --git a/src/darksend.h b/src/darksend.h index 2682e01758..e9cde99084 100644 --- a/src/darksend.h +++ b/src/darksend.h @@ -186,8 +186,8 @@ public: /** Sign this Darksend transaction * \return true if all conditions are met: - * 1) we have an active MasterNode, - * 2) we have a valid MasterNode private key, + * 1) we have an active Masternode, + * 2) we have a valid Masternode private key, * 3) we signed the message successfully, and * 4) we verified the message successfully */ @@ -201,7 +201,7 @@ public: return (GetTime() - time) > DARKSEND_QUEUE_TIMEOUT;// 120 seconds } - /// Check if we have a valid MasterNode address + /// Check if we have a valid Masternode address bool CheckSignature(); }; @@ -256,7 +256,7 @@ public: // clients entries std::vector myEntries; - // masternode entries + // Masternode entries std::vector entries; // the finalized transaction ready for signing CTransaction finalTransaction; @@ -288,7 +288,7 @@ public: int sessionID; int sessionDenom; //Users must submit an denom matching this int sessionUsers; //N Users have said they'll join - bool sessionFoundMasternode; //If we've found a compatible masternode + bool sessionFoundMasternode; //If we've found a compatible Masternode int64_t sessionTotalValue; //used for autoDenom std::vector vecSessionCollateral; @@ -406,7 +406,7 @@ public: void UpdateState(unsigned int newState) { if (fMasterNode && (newState == POOL_STATUS_ERROR || newState == POOL_STATUS_SUCCESS)){ - LogPrintf("CDarksendPool::UpdateState() - Can't set state to ERROR or SUCCESS as a masternode. \n"); + LogPrintf("CDarksendPool::UpdateState() - Can't set state to ERROR or SUCCESS as a Masternode. \n"); return; } @@ -475,9 +475,9 @@ public: bool AddScriptSig(const CTxIn& newVin); /// Check that all inputs are signed. (Are all inputs signed?) bool SignaturesComplete(); - /// As a client, send a transaction to a masternode to start the denomination process + /// As a client, send a transaction to a Masternode to start the denomination process void SendDarksendDenominate(std::vector& vin, std::vector& vout, int64_t amount); - /// Get masternode updates about the progress of Darksend + /// Get Masternode updates about the progress of Darksend bool StatusUpdate(int newState, int newEntriesCount, int newAccepted, std::string& error, int newSessionID=0); /// As a client, check and sign the final transaction diff --git a/src/masternode.h b/src/masternode.h index cb5b7ed596..a932530728 100644 --- a/src/masternode.h +++ b/src/masternode.h @@ -53,7 +53,7 @@ enum masternodeState { void ProcessMessageMasternodePayments(CNode* pfrom, std::string& strCommand, CDataStream& vRecv); // -// The Masternode Class. For managing the darksend process. It contains the input of the 1000DRK, signature to prove +// The Masternode Class. For managing the Darksend process. It contains the input of the 1000DRK, signature to prove // it's the one who own that ip address and code for calculating the payment election. // class CMasternode diff --git a/src/masternodeman.cpp b/src/masternodeman.cpp index 2ea99be716..1999bbe34d 100644 --- a/src/masternodeman.cpp +++ b/src/masternodeman.cpp @@ -140,7 +140,7 @@ bool CMasternodeMan::Add(CMasternode &mn) if (pmn == NULL) { - if(fDebug) LogPrintf("CMasternodeMan: Adding new masternode %s - %i now\n", mn.addr.ToString().c_str(), size() + 1); + if(fDebug) LogPrintf("CMasternodeMan: Adding new Masternode %s - %i now\n", mn.addr.ToString().c_str(), size() + 1); vMasternodes.push_back(mn); return true; } @@ -166,14 +166,14 @@ void CMasternodeMan::CheckAndRemove() vector::iterator it = vMasternodes.begin(); while(it != vMasternodes.end()){ if((*it).activeState == 4 || (*it).activeState == 3){ - if(fDebug) LogPrintf("CMasternodeMan: Removing inactive masternode %s - %i now\n", (*it).addr.ToString().c_str(), size() - 1); + if(fDebug) LogPrintf("CMasternodeMan: Removing inactive Masternode %s - %i now\n", (*it).addr.ToString().c_str(), size() - 1); it = vMasternodes.erase(it); } else { ++it; } } - // check who's asked for the masternode list + // check who's asked for the Masternode list map::iterator it1 = mAskedUsForMasternodeList.begin(); while(it1 != mAskedUsForMasternodeList.end()){ if((*it1).second < GetTime()) { @@ -183,7 +183,7 @@ void CMasternodeMan::CheckAndRemove() } } - // check who we asked for the masternode list + // check who we asked for the Masternode list it1 = mWeAskedForMasternodeList.begin(); while(it1 != mWeAskedForMasternodeList.end()){ if((*it1).second < GetTime()){ @@ -193,7 +193,7 @@ void CMasternodeMan::CheckAndRemove() } } - // check which masternodes we've asked for + // check which Masternodes we've asked for map::iterator it2 = mWeAskedForMasternodeListEntry.begin(); while(it2 != mWeAskedForMasternodeListEntry.end()){ if((*it2).second < GetTime()){ @@ -315,7 +315,7 @@ CMasternode* CMasternodeMan::GetCurrentMasterNode(int mod, int64_t nBlockHeight, mn.Check(); if(mn.protocolVersion < minProtocol || !mn.IsEnabled()) continue; - // calculate the score for each masternode + // calculate the score for each Masternode uint256 n = mn.CalculateScore(mod, nBlockHeight); unsigned int n2 = 0; memcpy(&n2, &n, sizeof(n2)); @@ -409,7 +409,7 @@ void CMasternodeMan::ProcessMasternodeConnections() if(darkSendPool.pSubmittedToMasternode->addr == pnode->addr) continue; if(pnode->fDarkSendMaster){ - LogPrintf("Closing masternode connection %s \n", pnode->addr.ToString().c_str()); + LogPrintf("Closing Masternode connection %s \n", pnode->addr.ToString().c_str()); pnode->CloseSocketDisconnect(); } } @@ -432,7 +432,7 @@ void CMasternodeMan::RelayMasternodeEntryPing(const CTxIn vin, const std::vector void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CDataStream& vRecv) { - if(fLiteMode) return; //disable all darksend/masternode related functionality + if(fLiteMode) return; //disable all Darksend/Masternode related functionality if(IsInitialBlockDownload()) return; LOCK(cs); @@ -469,7 +469,7 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData strMessage = addr.ToString() + boost::lexical_cast(sigTime) + vchPubKey + vchPubKey2 + boost::lexical_cast(protocolVersion); if(protocolVersion < nMasternodeMinProtocol) { - LogPrintf("dsee - ignoring outdated masternode %s protocol version %d\n", vin.ToString().c_str(), protocolVersion); + LogPrintf("dsee - ignoring outdated Masternode %s protocol version %d\n", vin.ToString().c_str(), protocolVersion); return; } @@ -493,7 +493,7 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData std::string errorMessage = ""; if(!darkSendSigner.VerifyMessage(pubkey, vchSig, strMessage, errorMessage)){ - LogPrintf("dsee - Got bad masternode address signature\n"); + LogPrintf("dsee - Got bad Masternode address signature\n"); Misbehaving(pfrom->GetId(), 100); return; } @@ -502,7 +502,7 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData if(addr.GetPort() != 9999) return; } - //search existing masternode list, this is where we update existing masternodes with new dsee broadcasts + //search existing Masternode list, this is where we update existing Masternodes with new dsee broadcasts CMasternode* pmn = this->Find(vin); if(pmn != NULL) { @@ -529,15 +529,15 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData return; } - // make sure the vout that was signed is related to the transaction that spawned the masternode - // - this is expensive, so it's only done once per masternode + // make sure the vout that was signed is related to the transaction that spawned the Masternode + // - this is expensive, so it's only done once per Masternode if(!darkSendSigner.IsVinAssociatedWithPubkey(vin, pubkey)) { LogPrintf("dsee - Got mismatched pubkey and vin\n"); Misbehaving(pfrom->GetId(), 100); return; } - if(fDebug) LogPrintf("dsee - Got NEW masternode entry %s\n", addr.ToString().c_str()); + if(fDebug) LogPrintf("dsee - Got NEW Masternode entry %s\n", addr.ToString().c_str()); // make sure it's still unspent // - this is checked later by .check() in many places and by ThreadCheckDarkSendPool() @@ -548,7 +548,7 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData tx.vin.push_back(vin); tx.vout.push_back(vout); if(AcceptableInputs(mempool, state, tx)){ - if(fDebug) LogPrintf("dsee - Accepted masternode entry %i %i\n", count, current); + if(fDebug) LogPrintf("dsee - Accepted Masternode entry %i %i\n", count, current); if(GetInputAge(vin) < MASTERNODE_MIN_CONFIRMATIONS){ LogPrintf("dsee - Input must have least %d confirmations\n", MASTERNODE_MIN_CONFIRMATIONS); @@ -567,7 +567,7 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData CBlockIndex* pConfIndex = chainActive[pMNIndex->nHeight + MASTERNODE_MIN_CONFIRMATIONS - 1]; // block where tx got MASTERNODE_MIN_CONFIRMATIONS if(pConfIndex->GetBlockTime() > sigTime) { - LogPrintf("dsee - Bad sigTime %d for masternode %20s %105s (%i conf block is at %d)\n", + LogPrintf("dsee - Bad sigTime %d for Masternode %20s %105s (%i conf block is at %d)\n", sigTime, addr.ToString(), vin.ToString(), MASTERNODE_MIN_CONFIRMATIONS, pConfIndex->GetBlockTime()); return; } @@ -577,12 +577,12 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData // use this as a peer addrman.Add(CAddress(addr), pfrom->addr, 2*60*60); - // add our masternode + // add our Masternode CMasternode mn(addr, vin, pubkey, vchSig, sigTime, pubkey2, protocolVersion); mn.UpdateLastSeen(lastUpdated); this->Add(mn); - // if it matches our masternodeprivkey, then we've been remotely activated + // if it matches our Masternode privkey, then we've been remotely activated if(pubkey2 == activeMasternode.pubKeyMasternode && protocolVersion == PROTOCOL_VERSION){ activeMasternode.EnableHotColdMasterNode(vin, addr); } @@ -591,7 +591,7 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData mnodeman.RelayMasternodeEntry(vin, addr, vchSig, sigTime, pubkey, pubkey2, count, current, lastUpdated, protocolVersion); } else { - LogPrintf("dsee - Rejected masternode entry %s\n", addr.ToString().c_str()); + LogPrintf("dsee - Rejected Masternode entry %s\n", addr.ToString().c_str()); int nDoS = 0; if (state.IsInvalid(nDoS)) @@ -624,7 +624,7 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData return; } - // see if we have this masternode + // see if we have this Masternode CMasternode* pmn = this->Find(vin); if(pmn != NULL) { @@ -637,7 +637,7 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData std::string errorMessage = ""; if(!darkSendSigner.VerifyMessage(pmn->pubkey2, vchSig, strMessage, errorMessage)) { - LogPrintf("dseep - Got bad masternode address signature %s \n", vin.ToString().c_str()); + LogPrintf("dseep - Got bad Masternode address signature %s \n", vin.ToString().c_str()); //Misbehaving(pfrom->GetId(), 100); return; } @@ -659,7 +659,7 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData return; } - if(fDebug) LogPrintf("dseep - Couldn't find masternode entry %s\n", vin.ToString().c_str()); + if(fDebug) LogPrintf("dseep - Couldn't find Masternode entry %s\n", vin.ToString().c_str()); std::map::iterator i = mWeAskedForMasternodeListEntry.find(vin.prevout); if (i != mWeAskedForMasternodeListEntry.end()) @@ -675,7 +675,7 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData int64_t askAgain = GetTime() + MASTERNODE_MIN_DSEEP_SECONDS; mWeAskedForMasternodeListEntry[vin.prevout] = askAgain; - } else if (strCommand == "dseg") { //Get masternode list or specific entry + } else if (strCommand == "dseg") { //Get Masternode list or specific entry CTxIn vin; vRecv >> vin; @@ -708,19 +708,19 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData if(mn.IsEnabled()) { - if(fDebug) LogPrintf("dseg - Sending masternode entry - %s \n", mn.addr.ToString().c_str()); + if(fDebug) LogPrintf("dseg - Sending Masternode entry - %s \n", mn.addr.ToString().c_str()); if(vin == CTxIn()){ pfrom->PushMessage("dsee", mn.vin, mn.addr, mn.sig, mn.sigTime, mn.pubkey, mn.pubkey2, count, i, mn.lastTimeSeen, mn.protocolVersion); } else if (vin == mn.vin) { pfrom->PushMessage("dsee", mn.vin, mn.addr, mn.sig, mn.sigTime, mn.pubkey, mn.pubkey2, count, i, mn.lastTimeSeen, mn.protocolVersion); - LogPrintf("dseg - Sent 1 masternode entries to %s\n", pfrom->addr.ToString().c_str()); + LogPrintf("dseg - Sent 1 Masternode entries to %s\n", pfrom->addr.ToString().c_str()); return; } i++; } } - LogPrintf("dseg - Sent %d masternode entries to %s\n", i, pfrom->addr.ToString().c_str()); + LogPrintf("dseg - Sent %d Masternode entries to %s\n", i, pfrom->addr.ToString().c_str()); } } @@ -729,10 +729,10 @@ std::string CMasternodeMan::ToString() { std::ostringstream info; - info << "masternodes: " << (int)vMasternodes.size() << - ", peers who asked us for masternode list: " << (int)mAskedUsForMasternodeList.size() << - ", peers we asked for masternode list: " << (int)mWeAskedForMasternodeList.size() << - ", entries in masternode list we asked for: " << (int)mWeAskedForMasternodeListEntry.size(); + info << "Masternodes: " << (int)vMasternodes.size() << + ", peers who asked us for Masternode list: " << (int)mAskedUsForMasternodeList.size() << + ", peers we asked for Masternode list: " << (int)mWeAskedForMasternodeList.size() << + ", entries in Masternode list we asked for: " << (int)mWeAskedForMasternodeListEntry.size(); return info.str(); } diff --git a/src/masternodeman.h b/src/masternodeman.h index 52923ca72a..887f1b27dc 100644 --- a/src/masternodeman.h +++ b/src/masternodeman.h @@ -26,7 +26,8 @@ class CMasternodeMan; extern CMasternodeMan mnodeman; void DumpMasternodes(); -/** Access to the MN database (masternodes.dat) */ +/** Access to the MN database (masternodes.dat) + */ class CMasternodeDB { private: @@ -45,11 +46,11 @@ private: // map to hold all MNs std::vector vMasternodes; - // who's asked for the masternode list and the last time + // who's asked for the Masternode list and the last time std::map mAskedUsForMasternodeList; - // who we asked for the masternode list and the last time + // who we asked for the Masternode list and the last time std::map mWeAskedForMasternodeList; - // which masternodes we've asked for + // which Masternodes we've asked for std::map mWeAskedForMasternodeListEntry; public: @@ -73,17 +74,16 @@ public: CMasternodeMan(); CMasternodeMan(CMasternodeMan& other); - // Add an entry - + /// Add an entry bool Add(CMasternode &mn); - // Check all masternodes + /// Check all Masternodes void Check(); - // Check all masternodes and remove inactive + /// Check all Masternodes and remove inactive void CheckAndRemove(); - // Clear masternode vector + /// Clear Masternode vector void Clear(); int CountEnabled(); @@ -92,16 +92,16 @@ public: void DsegUpdate(CNode* pnode); - // Find an entry + /// Find an entry CMasternode* Find(const CTxIn& vin); - //Find an entry thta do not match every entry provided vector + /// Find an entry thta do not match every entry provided vector CMasternode* FindOldestNotInVec(const std::vector &vVins); - // Find a random entry + /// Find a random entry CMasternode* FindRandom(); - // Get the current winner for this block + /// Get the current winner for this block CMasternode* GetCurrentMasterNode(int mod=1, int64_t nBlockHeight=0, int minProtocol=0); std::vector GetFullMasternodeVector() { Check(); return vMasternodes; } @@ -113,7 +113,7 @@ public: void ProcessMasternodeConnections(); - // Return the number of (unique) masternodes + /// Return the number of (unique) Masternodes int size() { return vMasternodes.size(); } std::string ToString(); From c8fe5a9cf754964929ef7f439633529758a8e867 Mon Sep 17 00:00:00 2001 From: Mike Kinney Date: Thu, 5 Mar 2015 00:11:56 -0800 Subject: [PATCH 3/3] V0.11.2.x update comments --- src/masternode.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/masternode.cpp b/src/masternode.cpp index 5db27c74fa..cd1b52c400 100644 --- a/src/masternode.cpp +++ b/src/masternode.cpp @@ -12,7 +12,7 @@ /** Object for who's going to get paid on which blocks */ CMasternodePayments masternodePayments; -// keep track of masternode votes I've seen +// keep track of Masternode votes I've seen map mapSeenMasternodeVotes; // keep track of the scanning errors I've seen map mapSeenMasternodeScanningErrors; @@ -24,7 +24,7 @@ void ProcessMessageMasternodePayments(CNode* pfrom, std::string& strCommand, CDa if(IsInitialBlockDownload()) return; if (strCommand == "mnget") { //Masternode Payments Request Sync - if(fLiteMode) return; //disable all darksend/masternode related functionality + if(fLiteMode) return; //disable all Darksend/Masternode related functionality if(pfrom->HasFulfilledRequest("mnget")) { LogPrintf("mnget - peer already asked me for the list\n"); @@ -34,7 +34,7 @@ void ProcessMessageMasternodePayments(CNode* pfrom, std::string& strCommand, CDa pfrom->FulfilledRequest("mnget"); masternodePayments.Sync(pfrom); - LogPrintf("mnget - Sent masternode winners to %s\n", pfrom->addr.ToString().c_str()); + LogPrintf("mnget - Sent Masternode winners to %s\n", pfrom->addr.ToString().c_str()); } else if (strCommand == "mnw") { //Masternode Payments Declare Winner //this is required in litemode @@ -185,7 +185,7 @@ CMasternode::CMasternode(CService newAddr, CTxIn newVin, CPubKey newPubkey, std: } // -// Deterministically calculate a given "score" for a masternode depending on how close it's hash is to +// Deterministically calculate a given "score" for a Masternode depending on how close it's hash is to // the proof of work for that block. The further away they are the better, the furthest will win the election // and get paid this block // @@ -263,7 +263,7 @@ bool CMasternodePayments::Sign(CMasternodePaymentWinner& winner) if(!darkSendSigner.SetKey(strMasterPrivKey, errorMessage, key2, pubkey2)) { - LogPrintf("CMasternodePayments::Sign - ERROR: Invalid masternodeprivkey: '%s'\n", errorMessage.c_str()); + LogPrintf("CMasternodePayments::Sign - ERROR: Invalid Masternodeprivkey: '%s'\n", errorMessage.c_str()); return false; } @@ -362,7 +362,7 @@ void CMasternodePayments::CleanPaymentList() vector::iterator it; for(it=vWinning.begin();itnHeight - (*it).nBlockHeight > nLimit){ - if(fDebug) LogPrintf("CMasternodePayments::CleanPaymentList - Removing old masternode payment - block %d\n", (*it).nBlockHeight); + if(fDebug) LogPrintf("CMasternodePayments::CleanPaymentList - Removing old Masternode payment - block %d\n", (*it).nBlockHeight); vWinning.erase(it); break; } @@ -459,7 +459,7 @@ bool CMasternodePayments::SetPrivKey(std::string strPrivKey) Sign(winner); if(CheckSignature(winner)){ - LogPrintf("CMasternodePayments::SetPrivKey - Successfully initialized as masternode payments master\n"); + LogPrintf("CMasternodePayments::SetPrivKey - Successfully initialized as Masternode payments master\n"); enabled = true; return true; } else {