From aee86618cdaba1af24d46f228b20e1089fe0e523 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Thu, 5 May 2016 10:30:28 -0700 Subject: [PATCH] fixed greedy find/replace (opps) --- src/governance.cpp | 12 ++++++------ src/main.cpp | 4 ++-- src/masternode-budget.cpp | 12 ++++++------ src/masternode-sync.cpp | 2 +- src/protocol.cpp | 28 ++++++++++++++-------------- src/protocol.h | 10 +++++----- src/rpcclient.cpp | 4 ++-- src/rpcmasternode-budget.cpp | 4 ++-- src/rpcserver.cpp | 2 +- src/rpcserver.h | 2 +- 10 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/governance.cpp b/src/governance.cpp index 231ad1878f..3f589e525b 100644 --- a/src/governance.cpp +++ b/src/governance.cpp @@ -295,18 +295,18 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, std::string& strCommand, C LOCK(cs_budget); // todo - 12.1 - change to MNGOVERNANCEVOTESYNC - if (strCommand == NetMsgType::mngovernanceVOTESYNC) { //Masternode vote sync + if (strCommand == NetMsgType::MNGOVERNANCEVOTESYNC) { //Masternode vote sync uint256 nProp; vRecv >> nProp; if(Params().NetworkIDString() == CBaseChainParams::MAIN){ if(nProp == uint256()) { - if(pfrom->HasFulfilledRequest(NetMsgType::mngovernanceVOTESYNC)) { + if(pfrom->HasFulfilledRequest(NetMsgType::MNGOVERNANCEVOTESYNC)) { LogPrintf("mnvs - peer already asked me for the list\n"); Misbehaving(pfrom->GetId(), 20); return; } - pfrom->FulfilledRequest(NetMsgType::mngovernanceVOTESYNC); + pfrom->FulfilledRequest(NetMsgType::MNGOVERNANCEVOTESYNC); } } @@ -316,7 +316,7 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, std::string& strCommand, C } // todo - 12.1 - change to MNGOVERNANCEPROPOSAL - if (strCommand == NetMsgType::mngovernancePROPOSAL) { //Masternode Proposal + if (strCommand == NetMsgType::MNGOVERNANCEPROPOSAL) { //Masternode Proposal CGovernanceObject budgetProposalBroadcast; vRecv >> budgetProposalBroadcast; @@ -351,7 +351,7 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, std::string& strCommand, C } // todo - 12.1 - change to MNGOVERNANCEVOTE - if (strCommand == NetMsgType::mngovernanceVOTE) { //Masternode Vote + if (strCommand == NetMsgType::MNGOVERNANCEVOTE) { //Masternode Vote CBudgetVote vote; vRecv >> vote; vote.fValid = true; @@ -494,7 +494,7 @@ bool CGovernanceManager::UpdateProposal(CBudgetVote& vote, CNode* pfrom, std::st mapOrphanMasternodeBudgetVotes[vote.nParentHash] = vote; if(!askedForSourceProposalOrBudget.count(vote.nParentHash)){ - pfrom->PushMessage(NetMsgType::mngovernanceVOTESYNC, vote.nParentHash); + pfrom->PushMessage(NetMsgType::MNGOVERNANCEVOTESYNC, vote.nParentHash); askedForSourceProposalOrBudget[vote.nParentHash] = GetTime(); } } diff --git a/src/main.cpp b/src/main.cpp index 3b61433b0e..f33971bd04 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4580,7 +4580,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); ss.reserve(1000); ss << governance.mapSeenMasternodeBudgetVotes[inv.hash]; - pfrom->PushMessage(NetMsgType::mngovernanceVOTE, ss); + pfrom->PushMessage(NetMsgType::MNGOVERNANCEVOTE, ss); pushed = true; } } @@ -4590,7 +4590,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); ss.reserve(1000); ss << governance.mapSeenMasternodeBudgetProposals[inv.hash]; - pfrom->PushMessage(NetMsgType::mngovernancePROPOSAL, ss); + pfrom->PushMessage(NetMsgType::MNGOVERNANCEPROPOSAL, ss); pushed = true; } } diff --git a/src/masternode-budget.cpp b/src/masternode-budget.cpp index 06a5bb398a..03cda16c54 100644 --- a/src/masternode-budget.cpp +++ b/src/masternode-budget.cpp @@ -146,18 +146,18 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData // todo : 12.1 - split out into two messages // --- one for finalized budgets and one for gov objs - if (strCommand == NetMsgType::mngovernanceVOTESYNC) { //Masternode vote sync + if (strCommand == NetMsgType::MNGOVERNANCEVOTESYNC) { //Masternode vote sync uint256 nProp; vRecv >> nProp; if(Params().NetworkIDString() == CBaseChainParams::MAIN){ if(nProp == uint256()) { - if(pfrom->HasFulfilledRequest(NetMsgType::mngovernanceVOTESYNC)) { + if(pfrom->HasFulfilledRequest(NetMsgType::MNGOVERNANCEVOTESYNC)) { LogPrintf("mnvs - peer already asked me for the list\n"); Misbehaving(pfrom->GetId(), 20); return; } - pfrom->FulfilledRequest(NetMsgType::mngovernanceVOTESYNC); + pfrom->FulfilledRequest(NetMsgType::MNGOVERNANCEVOTESYNC); } } @@ -165,7 +165,7 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData LogPrintf("mnvs - Sent Masternode votes to %s\n", pfrom->addr.ToString()); } - if (strCommand == NetMsgType::mngovernanceFINAL) { //Finalized Budget Suggestion + if (strCommand == NetMsgType::MNGOVERNANCEFINAL) { //Finalized Budget Suggestion CFinalizedBudget finalizedBudgetBroadcast; vRecv >> finalizedBudgetBroadcast; @@ -200,7 +200,7 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData CheckOrphanVotes(); } - if (strCommand == NetMsgType::mngovernanceFINALVOTE) { //Finalized Budget Vote + if (strCommand == NetMsgType::MNGOVERNANCEFINALVOTE) { //Finalized Budget Vote CBudgetVote vote; vRecv >> vote; vote.fValid = true; @@ -416,7 +416,7 @@ bool CBudgetManager::UpdateFinalizedBudget(CBudgetVote& vote, CNode* pfrom, std: mapOrphanFinalizedBudgetVotes[vote.nBudgetHash] = vote; if(!askedForSourceProposalOrBudget.count(vote.nBudgetHash)){ - pfrom->PushMessage(NetMsgType::mngovernanceVOTESYNC, vote.nBudgetHash); + pfrom->PushMessage(NetMsgType::MNGOVERNANCEVOTESYNC, vote.nBudgetHash); askedForSourceProposalOrBudget[vote.nBudgetHash] = GetTime(); } diff --git a/src/masternode-sync.cpp b/src/masternode-sync.cpp index 144ff69645..913d318b1c 100644 --- a/src/masternode-sync.cpp +++ b/src/masternode-sync.cpp @@ -259,7 +259,7 @@ void CMasternodeSync::Process() int nMnCount = mnodeman.CountEnabled(); pnode->PushMessage(NetMsgType::MNWINNERSSYNC, nMnCount); //sync payees uint256 n = uint256(); - pnode->PushMessage(NetMsgType::mngovernanceVOTESYNC, n); //sync masternode votes + pnode->PushMessage(NetMsgType::MNGOVERNANCEVOTESYNC, n); //sync masternode votes } else { RequestedMasternodeAssets = MASTERNODE_SYNC_FINISHED; } diff --git a/src/protocol.cpp b/src/protocol.cpp index e67a3e3ff8..c3aa6143f4 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -43,11 +43,11 @@ const char *GETSPORKS="getsporks"; const char *MNWINNER="mnw"; const char *MNWINNERSSYNC="mnget"; const char *MNSCANERROR="mn scan error"; // TODO ??? -const char *mngovernanceVOTESYNC="mnvs"; -const char *mngovernanceVOTE="mvote"; -const char *mngovernancePROPOSAL="mprop"; -const char *mngovernanceFINAL="fbs"; -const char *mngovernanceFINALVOTE="fbvote"; +const char *MNGOVERNANCEVOTESYNC="mnvs"; +const char *MNGOVERNANCEVOTE="mvote"; +const char *MNGOVERNANCEPROPOSAL="mprop"; +const char *MNGOVERNANCEFINAL="fbs"; +const char *MNGOVERNANCEFINALVOTE="fbvote"; const char *MNQUORUM="mn quorum"; // TODO ??? const char *MNANNOUNCE="mnb"; const char *MNPING="mnp"; @@ -75,10 +75,10 @@ static const char* ppszTypeName[] = NetMsgType::SPORK, NetMsgType::MNWINNER, NetMsgType::MNSCANERROR, - NetMsgType::mngovernanceVOTE, - NetMsgType::mngovernancePROPOSAL, - NetMsgType::mngovernanceFINAL, - NetMsgType::mngovernanceFINALVOTE, + NetMsgType::MNGOVERNANCEVOTE, + NetMsgType::MNGOVERNANCEPROPOSAL, + NetMsgType::MNGOVERNANCEFINAL, + NetMsgType::MNGOVERNANCEFINALVOTE, NetMsgType::MNQUORUM, NetMsgType::MNANNOUNCE, NetMsgType::MNPING, @@ -119,11 +119,11 @@ const static std::string allNetMessageTypes[] = { NetMsgType::MNWINNER, NetMsgType::MNWINNERSSYNC, NetMsgType::MNSCANERROR, - NetMsgType::mngovernanceVOTESYNC, - NetMsgType::mngovernanceVOTE, - NetMsgType::mngovernancePROPOSAL, - NetMsgType::mngovernanceFINAL, - NetMsgType::mngovernanceFINALVOTE, + NetMsgType::MNGOVERNANCEVOTESYNC, + NetMsgType::MNGOVERNANCEVOTE, + NetMsgType::MNGOVERNANCEPROPOSAL, + NetMsgType::MNGOVERNANCEFINAL, + NetMsgType::MNGOVERNANCEFINALVOTE, NetMsgType::MNQUORUM, NetMsgType::MNANNOUNCE, NetMsgType::MNPING, diff --git a/src/protocol.h b/src/protocol.h index b251e3fb56..de6f0b72e5 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -228,11 +228,11 @@ extern const char *GETSPORKS; extern const char *MNWINNER; extern const char *MNWINNERSSYNC; extern const char *MNSCANERROR; -extern const char *mngovernanceVOTESYNC; -extern const char *mngovernanceVOTE; -extern const char *mngovernancePROPOSAL; -extern const char *mngovernanceFINAL; -extern const char *mngovernanceFINALVOTE; +extern const char *MNGOVERNANCEVOTESYNC; +extern const char *MNGOVERNANCEVOTE; +extern const char *MNGOVERNANCEPROPOSAL; +extern const char *MNGOVERNANCEFINAL; +extern const char *MNGOVERNANCEFINALVOTE; extern const char *MNQUORUM; extern const char *MNANNOUNCE; extern const char *MNPING; diff --git a/src/rpcclient.cpp b/src/rpcclient.cpp index a2d46ec5d7..064237c3ad 100644 --- a/src/rpcclient.cpp +++ b/src/rpcclient.cpp @@ -111,8 +111,8 @@ static const CRPCConvertParam vRPCConvertParams[] = { "setban", 2 }, { "setban", 3 }, { "spork", 1 }, - { "mngovernancevoteraw", 1 }, - { "mngovernancevoteraw", 4 }, + { "MNGOVERNANCEVOTEraw", 1 }, + { "MNGOVERNANCEVOTEraw", 4 }, }; class CRPCConvertTable diff --git a/src/rpcmasternode-budget.cpp b/src/rpcmasternode-budget.cpp index d5478c7c39..fbf08d1725 100644 --- a/src/rpcmasternode-budget.cpp +++ b/src/rpcmasternode-budget.cpp @@ -412,11 +412,11 @@ UniValue mngovernance(const UniValue& params, bool fHelp) return NullUniValue; } -UniValue mngovernancevoteraw(const UniValue& params, bool fHelp) +UniValue MNGOVERNANCEVOTEraw(const UniValue& params, bool fHelp) { if (fHelp || params.size() != 6) throw runtime_error( - "mngovernancevoteraw [yes|no|abstain]