From 49214d0232537b0c98e295246cb255433689088e Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Mon, 23 Mar 2015 18:16:28 -0700 Subject: [PATCH] Removed donation flag --- src/activemasternode.cpp | 18 ------------ src/init.cpp | 7 ----- src/rpcdarksend.cpp | 59 ++-------------------------------------- src/util.cpp | 2 -- src/util.h | 1 - 5 files changed, 3 insertions(+), 84 deletions(-) diff --git a/src/activemasternode.cpp b/src/activemasternode.cpp index 8c0e9d270..c572a4b4b 100644 --- a/src/activemasternode.cpp +++ b/src/activemasternode.cpp @@ -109,24 +109,6 @@ void CActiveMasternode::ManageStatus() CScript donationAddress = CScript(); int donationPercentage = 0; - if(nDonate == 1){ - std::string strDonationAddress = ""; - if(Params().NetworkID() == CChainParams::MAIN){ - strDonationAddress = "7gnwGHt17heGpG9Crfeh4KGpYNFugPhJdh"; - } else { - strDonationAddress = "xwe6mWeZQsbbM9P2LQ5t5cWArHtCLAuV4N"; - } - - CBitcoinAddress address; - if(!address.SetString(strDonationAddress)) - { - LogPrintf("CActiveMasternode::ManageStatus() - Invalid Donation Address\n"); - return; - } - donationAddress.SetDestination(address.Get()); - donationPercentage = 5; //5% - } - if(!Register(vin, service, keyCollateralAddress, pubKeyCollateralAddress, keyMasternode, pubKeyMasternode, donationAddress, donationPercentage, errorMessage)) { LogPrintf("CActiveMasternode::ManageStatus() - Error on Register: %s\n", errorMessage.c_str()); } diff --git a/src/init.cpp b/src/init.cpp index 472303c23..2dd81ec68 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1148,13 +1148,6 @@ bool AppInit2(boost::thread_group& threadGroup) // ********************************************************* Step 10: setup DarkSend - std::string strDonate = GetArg("-donate", ""); - if(strDonate != ""){ - if(strDonate == "yes" || strDonate == "true") nDonate = 1; - else if(strDonate == "no" || strDonate == "false") nDonate = -1; - else return InitError("Invalid donate mode, must be yes or no: " + strDonate); - } - //string strNode = "23.23.186.131"; //CAddress addr; //ConnectNode(addr, strNode.c_str(), true); diff --git a/src/rpcdarksend.cpp b/src/rpcdarksend.cpp index c6fef10e5..b19fffc68 100644 --- a/src/rpcdarksend.cpp +++ b/src/rpcdarksend.cpp @@ -91,7 +91,7 @@ Value masternode(const Array& params, bool fHelp) if (fHelp || (strCommand != "start" && strCommand != "start-alias" && strCommand != "start-many" && strCommand != "stop" && strCommand != "stop-alias" && strCommand != "stop-many" && strCommand != "list" && strCommand != "list-conf" && strCommand != "count" && strCommand != "enforce" - && strCommand != "debug" && strCommand != "current" && strCommand != "winners" && strCommand != "genkey" && strCommand != "connect" && strCommand != "outputs" && strCommand != "vote-many" && strCommand != "vote" && strCommand != "donate")) + && strCommand != "debug" && strCommand != "current" && strCommand != "winners" && strCommand != "genkey" && strCommand != "connect" && strCommand != "outputs" && strCommand != "vote-many" && strCommand != "vote")) throw runtime_error( "masternode \"command\"... ( \"passphrase\" )\n" "Set of commands to execute masternode related actions\n" @@ -116,19 +116,8 @@ Value masternode(const Array& params, bool fHelp) " winners - Print list of masternode winners\n" " vote-many - Vote on a Dash initiative\n" " vote - Vote on a Dash initiative\n" - " donate - Donate to support development (yes or no)\n" ); - // *** string returned when no donation mode is set **** - std::string strNoDonateModeSet = ""; - if(nDonate == 0) { - strNoDonateModeSet += "---------- Please Support Dash Development! --------------\n\n"; - strNoDonateModeSet += "Dash now allows you to support future development by redirecting a small part (5%) of your masternode earnings "; - strNoDonateModeSet += "to the Darkcoin Foundation, which will be used to pay developers for bringing this project to the next level. "; - strNoDonateModeSet += "If you would like to donate, please execute \"masternode donate yes\" then start your node again. To avoid this "; - strNoDonateModeSet += "message in the future add \"donate=yes\" or \"donate=no\" to your configuration.\n"; - } - // ******************************************************** if (strCommand == "stop") { @@ -291,19 +280,6 @@ Value masternode(const Array& params, bool fHelp) return mnodeman.size(); } - if (strCommand == "donate") - { - - std::string strYesOrNo = params[1].get_str().c_str(); - - if(strYesOrNo != "yes" && strYesOrNo != "no") return "You can say 'yes' or 'no'"; - if(strYesOrNo == "yes") nDonate = 1; - if(strYesOrNo == "no") nDonate = -1; - - if(strYesOrNo == "yes") return "Thankyou for supporting the development of Dash! You may now start your masternode(s)."; - return "Successfully set donation mode to no. You may now start your masternode(s)."; - } - if (strCommand == "start") { if(!fMasterNode) return "you must set masternode=1 in the configuration"; @@ -324,9 +300,6 @@ Value masternode(const Array& params, bool fHelp) } } - //ask user to specify if they would like to support the project - if(nDonate == 0) return strNoDonateModeSet; - if(activeMasternode.status != MASTERNODE_REMOTELY_ENABLED && activeMasternode.status != MASTERNODE_IS_CAPABLE){ activeMasternode.status = MASTERNODE_NOT_PROCESSED; // TODO: consider better way std::string errorMessage; @@ -371,9 +344,6 @@ Value masternode(const Array& params, bool fHelp) bool found = false; - //ask user to specify if they would like to support the project - if(nDonate == 0) return strNoDonateModeSet; - Object statusObj; statusObj.push_back(Pair("alias", alias)); @@ -385,16 +355,6 @@ Value masternode(const Array& params, bool fHelp) std::string strDonateAddress = mne.getDonationAddress(); std::string strDonationPercentage = mne.getDonationPercentage(); - if(nDonate == 1){ - if(Params().NetworkID() == CChainParams::MAIN){ - strDonateAddress = "7gnwGHt17heGpG9Crfeh4KGpYNFugPhJdh"; - strDonationPercentage = "5"; //5% - } else { - strDonateAddress = "xwe6mWeZQsbbM9P2LQ5t5cWArHtCLAuV4N"; - strDonationPercentage = "5"; //5% - } - } - bool result = activeMasternode.Register(mne.getIp(), mne.getPrivKey(), mne.getTxHash(), mne.getOutputIndex(), strDonateAddress, strDonationPercentage, errorMessage); statusObj.push_back(Pair("result", result ? "successful" : "failed")); @@ -442,9 +402,6 @@ Value masternode(const Array& params, bool fHelp) Object resultsObj; - //ask user to specify if they would like to support the project - if(nDonate == 0) return strNoDonateModeSet; - BOOST_FOREACH(CMasternodeConfig::CMasternodeEntry mne, masternodeConfig.getEntries()) { total++; @@ -453,16 +410,6 @@ Value masternode(const Array& params, bool fHelp) std::string strDonateAddress = mne.getDonationAddress(); std::string strDonationPercentage = mne.getDonationPercentage(); - if(nDonate == 1){ - if(Params().NetworkID() == CChainParams::MAIN){ - strDonateAddress = "7gnwGHt17heGpG9Crfeh4KGpYNFugPhJdh"; - strDonationPercentage = "5"; //5% - } else { - strDonateAddress = "xwe6mWeZQsbbM9P2LQ5t5cWArHtCLAuV4N"; - strDonationPercentage = "5"; //5% - } - } - bool result = activeMasternode.Register(mne.getIp(), mne.getPrivKey(), mne.getTxHash(), mne.getOutputIndex(), strDonateAddress, strDonationPercentage, errorMessage); Object statusObj; @@ -721,7 +668,7 @@ Value masternodelist(const Array& params, bool fHelp) if (params.size() == 2) strFilter = params[1].get_str(); if (fHelp || - (strMode != "active" && strMode != "vin" && strMode != "pubkey" && strMode != "lastseen" && strMode != "activeseconds" && strMode != "rank" + (strMode != "active" && strMode != "vin" && strMode != "pubkey" && strMode != "lastseen" && strMode != "activeseconds" && strMode != "rank" && strMode != "protocol" && strMode != "full" && strMode != "votes" && strMode != "donation" && strMode != "pose")) { throw runtime_error( @@ -846,7 +793,7 @@ Value masternodelist(const Array& params, bool fHelp) if(strFilter !="" && strAddr.find(strFilter) == string::npos) continue; std::string strOut = boost::lexical_cast(mn.nScanningErrorCount); - + obj.push_back(Pair(strAddr, strOut.c_str())); } else if (strMode == "vin") { if(strFilter !="" && mn.vin.prevout.hash.ToString().find(strFilter) == string::npos && diff --git a/src/util.cpp b/src/util.cpp index edb9fbcba..9a5fc587a 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -109,8 +109,6 @@ bool fSucessfullyLoaded = false; bool fEnableDarksend = false; /** All denominations used by darksend */ std::vector darkSendDenominations; -// Donate 5% of masternode earnings to development -int nDonate = 0; map mapArgs; map > mapMultiArgs; diff --git a/src/util.h b/src/util.h index cb2e2698b..cdb92b9ed 100644 --- a/src/util.h +++ b/src/util.h @@ -107,7 +107,6 @@ extern int nMasternodeMinProtocol; extern int keysLoaded; extern bool fSucessfullyLoaded; extern std::vector darkSendDenominations; -extern int nDonate; extern std::map mapArgs; extern std::map > mapMultiArgs;