fixed greedy find/replace (opps)

This commit is contained in:
Evan Duffield 2016-05-05 10:30:28 -07:00
parent f2de437f05
commit aee86618cd
10 changed files with 40 additions and 40 deletions

View File

@ -295,18 +295,18 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, std::string& strCommand, C
LOCK(cs_budget); LOCK(cs_budget);
// todo - 12.1 - change to MNGOVERNANCEVOTESYNC // todo - 12.1 - change to MNGOVERNANCEVOTESYNC
if (strCommand == NetMsgType::mngovernanceVOTESYNC) { //Masternode vote sync if (strCommand == NetMsgType::MNGOVERNANCEVOTESYNC) { //Masternode vote sync
uint256 nProp; uint256 nProp;
vRecv >> nProp; vRecv >> nProp;
if(Params().NetworkIDString() == CBaseChainParams::MAIN){ if(Params().NetworkIDString() == CBaseChainParams::MAIN){
if(nProp == uint256()) { if(nProp == uint256()) {
if(pfrom->HasFulfilledRequest(NetMsgType::mngovernanceVOTESYNC)) { if(pfrom->HasFulfilledRequest(NetMsgType::MNGOVERNANCEVOTESYNC)) {
LogPrintf("mnvs - peer already asked me for the list\n"); LogPrintf("mnvs - peer already asked me for the list\n");
Misbehaving(pfrom->GetId(), 20); Misbehaving(pfrom->GetId(), 20);
return; 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 // todo - 12.1 - change to MNGOVERNANCEPROPOSAL
if (strCommand == NetMsgType::mngovernancePROPOSAL) { //Masternode Proposal if (strCommand == NetMsgType::MNGOVERNANCEPROPOSAL) { //Masternode Proposal
CGovernanceObject budgetProposalBroadcast; CGovernanceObject budgetProposalBroadcast;
vRecv >> budgetProposalBroadcast; vRecv >> budgetProposalBroadcast;
@ -351,7 +351,7 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, std::string& strCommand, C
} }
// todo - 12.1 - change to MNGOVERNANCEVOTE // todo - 12.1 - change to MNGOVERNANCEVOTE
if (strCommand == NetMsgType::mngovernanceVOTE) { //Masternode Vote if (strCommand == NetMsgType::MNGOVERNANCEVOTE) { //Masternode Vote
CBudgetVote vote; CBudgetVote vote;
vRecv >> vote; vRecv >> vote;
vote.fValid = true; vote.fValid = true;
@ -494,7 +494,7 @@ bool CGovernanceManager::UpdateProposal(CBudgetVote& vote, CNode* pfrom, std::st
mapOrphanMasternodeBudgetVotes[vote.nParentHash] = vote; mapOrphanMasternodeBudgetVotes[vote.nParentHash] = vote;
if(!askedForSourceProposalOrBudget.count(vote.nParentHash)){ if(!askedForSourceProposalOrBudget.count(vote.nParentHash)){
pfrom->PushMessage(NetMsgType::mngovernanceVOTESYNC, vote.nParentHash); pfrom->PushMessage(NetMsgType::MNGOVERNANCEVOTESYNC, vote.nParentHash);
askedForSourceProposalOrBudget[vote.nParentHash] = GetTime(); askedForSourceProposalOrBudget[vote.nParentHash] = GetTime();
} }
} }

View File

@ -4580,7 +4580,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss.reserve(1000); ss.reserve(1000);
ss << governance.mapSeenMasternodeBudgetVotes[inv.hash]; ss << governance.mapSeenMasternodeBudgetVotes[inv.hash];
pfrom->PushMessage(NetMsgType::mngovernanceVOTE, ss); pfrom->PushMessage(NetMsgType::MNGOVERNANCEVOTE, ss);
pushed = true; pushed = true;
} }
} }
@ -4590,7 +4590,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss.reserve(1000); ss.reserve(1000);
ss << governance.mapSeenMasternodeBudgetProposals[inv.hash]; ss << governance.mapSeenMasternodeBudgetProposals[inv.hash];
pfrom->PushMessage(NetMsgType::mngovernancePROPOSAL, ss); pfrom->PushMessage(NetMsgType::MNGOVERNANCEPROPOSAL, ss);
pushed = true; pushed = true;
} }
} }

View File

@ -146,18 +146,18 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
// todo : 12.1 - split out into two messages // todo : 12.1 - split out into two messages
// --- one for finalized budgets and one for gov objs // --- 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; uint256 nProp;
vRecv >> nProp; vRecv >> nProp;
if(Params().NetworkIDString() == CBaseChainParams::MAIN){ if(Params().NetworkIDString() == CBaseChainParams::MAIN){
if(nProp == uint256()) { if(nProp == uint256()) {
if(pfrom->HasFulfilledRequest(NetMsgType::mngovernanceVOTESYNC)) { if(pfrom->HasFulfilledRequest(NetMsgType::MNGOVERNANCEVOTESYNC)) {
LogPrintf("mnvs - peer already asked me for the list\n"); LogPrintf("mnvs - peer already asked me for the list\n");
Misbehaving(pfrom->GetId(), 20); Misbehaving(pfrom->GetId(), 20);
return; 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()); 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; CFinalizedBudget finalizedBudgetBroadcast;
vRecv >> finalizedBudgetBroadcast; vRecv >> finalizedBudgetBroadcast;
@ -200,7 +200,7 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
CheckOrphanVotes(); CheckOrphanVotes();
} }
if (strCommand == NetMsgType::mngovernanceFINALVOTE) { //Finalized Budget Vote if (strCommand == NetMsgType::MNGOVERNANCEFINALVOTE) { //Finalized Budget Vote
CBudgetVote vote; CBudgetVote vote;
vRecv >> vote; vRecv >> vote;
vote.fValid = true; vote.fValid = true;
@ -416,7 +416,7 @@ bool CBudgetManager::UpdateFinalizedBudget(CBudgetVote& vote, CNode* pfrom, std:
mapOrphanFinalizedBudgetVotes[vote.nBudgetHash] = vote; mapOrphanFinalizedBudgetVotes[vote.nBudgetHash] = vote;
if(!askedForSourceProposalOrBudget.count(vote.nBudgetHash)){ if(!askedForSourceProposalOrBudget.count(vote.nBudgetHash)){
pfrom->PushMessage(NetMsgType::mngovernanceVOTESYNC, vote.nBudgetHash); pfrom->PushMessage(NetMsgType::MNGOVERNANCEVOTESYNC, vote.nBudgetHash);
askedForSourceProposalOrBudget[vote.nBudgetHash] = GetTime(); askedForSourceProposalOrBudget[vote.nBudgetHash] = GetTime();
} }

View File

@ -259,7 +259,7 @@ void CMasternodeSync::Process()
int nMnCount = mnodeman.CountEnabled(); int nMnCount = mnodeman.CountEnabled();
pnode->PushMessage(NetMsgType::MNWINNERSSYNC, nMnCount); //sync payees pnode->PushMessage(NetMsgType::MNWINNERSSYNC, nMnCount); //sync payees
uint256 n = uint256(); uint256 n = uint256();
pnode->PushMessage(NetMsgType::mngovernanceVOTESYNC, n); //sync masternode votes pnode->PushMessage(NetMsgType::MNGOVERNANCEVOTESYNC, n); //sync masternode votes
} else { } else {
RequestedMasternodeAssets = MASTERNODE_SYNC_FINISHED; RequestedMasternodeAssets = MASTERNODE_SYNC_FINISHED;
} }

View File

@ -43,11 +43,11 @@ const char *GETSPORKS="getsporks";
const char *MNWINNER="mnw"; const char *MNWINNER="mnw";
const char *MNWINNERSSYNC="mnget"; const char *MNWINNERSSYNC="mnget";
const char *MNSCANERROR="mn scan error"; // TODO ??? const char *MNSCANERROR="mn scan error"; // TODO ???
const char *mngovernanceVOTESYNC="mnvs"; const char *MNGOVERNANCEVOTESYNC="mnvs";
const char *mngovernanceVOTE="mvote"; const char *MNGOVERNANCEVOTE="mvote";
const char *mngovernancePROPOSAL="mprop"; const char *MNGOVERNANCEPROPOSAL="mprop";
const char *mngovernanceFINAL="fbs"; const char *MNGOVERNANCEFINAL="fbs";
const char *mngovernanceFINALVOTE="fbvote"; const char *MNGOVERNANCEFINALVOTE="fbvote";
const char *MNQUORUM="mn quorum"; // TODO ??? const char *MNQUORUM="mn quorum"; // TODO ???
const char *MNANNOUNCE="mnb"; const char *MNANNOUNCE="mnb";
const char *MNPING="mnp"; const char *MNPING="mnp";
@ -75,10 +75,10 @@ static const char* ppszTypeName[] =
NetMsgType::SPORK, NetMsgType::SPORK,
NetMsgType::MNWINNER, NetMsgType::MNWINNER,
NetMsgType::MNSCANERROR, NetMsgType::MNSCANERROR,
NetMsgType::mngovernanceVOTE, NetMsgType::MNGOVERNANCEVOTE,
NetMsgType::mngovernancePROPOSAL, NetMsgType::MNGOVERNANCEPROPOSAL,
NetMsgType::mngovernanceFINAL, NetMsgType::MNGOVERNANCEFINAL,
NetMsgType::mngovernanceFINALVOTE, NetMsgType::MNGOVERNANCEFINALVOTE,
NetMsgType::MNQUORUM, NetMsgType::MNQUORUM,
NetMsgType::MNANNOUNCE, NetMsgType::MNANNOUNCE,
NetMsgType::MNPING, NetMsgType::MNPING,
@ -119,11 +119,11 @@ const static std::string allNetMessageTypes[] = {
NetMsgType::MNWINNER, NetMsgType::MNWINNER,
NetMsgType::MNWINNERSSYNC, NetMsgType::MNWINNERSSYNC,
NetMsgType::MNSCANERROR, NetMsgType::MNSCANERROR,
NetMsgType::mngovernanceVOTESYNC, NetMsgType::MNGOVERNANCEVOTESYNC,
NetMsgType::mngovernanceVOTE, NetMsgType::MNGOVERNANCEVOTE,
NetMsgType::mngovernancePROPOSAL, NetMsgType::MNGOVERNANCEPROPOSAL,
NetMsgType::mngovernanceFINAL, NetMsgType::MNGOVERNANCEFINAL,
NetMsgType::mngovernanceFINALVOTE, NetMsgType::MNGOVERNANCEFINALVOTE,
NetMsgType::MNQUORUM, NetMsgType::MNQUORUM,
NetMsgType::MNANNOUNCE, NetMsgType::MNANNOUNCE,
NetMsgType::MNPING, NetMsgType::MNPING,

View File

@ -228,11 +228,11 @@ extern const char *GETSPORKS;
extern const char *MNWINNER; extern const char *MNWINNER;
extern const char *MNWINNERSSYNC; extern const char *MNWINNERSSYNC;
extern const char *MNSCANERROR; extern const char *MNSCANERROR;
extern const char *mngovernanceVOTESYNC; extern const char *MNGOVERNANCEVOTESYNC;
extern const char *mngovernanceVOTE; extern const char *MNGOVERNANCEVOTE;
extern const char *mngovernancePROPOSAL; extern const char *MNGOVERNANCEPROPOSAL;
extern const char *mngovernanceFINAL; extern const char *MNGOVERNANCEFINAL;
extern const char *mngovernanceFINALVOTE; extern const char *MNGOVERNANCEFINALVOTE;
extern const char *MNQUORUM; extern const char *MNQUORUM;
extern const char *MNANNOUNCE; extern const char *MNANNOUNCE;
extern const char *MNPING; extern const char *MNPING;

View File

@ -111,8 +111,8 @@ static const CRPCConvertParam vRPCConvertParams[] =
{ "setban", 2 }, { "setban", 2 },
{ "setban", 3 }, { "setban", 3 },
{ "spork", 1 }, { "spork", 1 },
{ "mngovernancevoteraw", 1 }, { "MNGOVERNANCEVOTEraw", 1 },
{ "mngovernancevoteraw", 4 }, { "MNGOVERNANCEVOTEraw", 4 },
}; };
class CRPCConvertTable class CRPCConvertTable

View File

@ -412,11 +412,11 @@ UniValue mngovernance(const UniValue& params, bool fHelp)
return NullUniValue; return NullUniValue;
} }
UniValue mngovernancevoteraw(const UniValue& params, bool fHelp) UniValue MNGOVERNANCEVOTEraw(const UniValue& params, bool fHelp)
{ {
if (fHelp || params.size() != 6) if (fHelp || params.size() != 6)
throw runtime_error( throw runtime_error(
"mngovernancevoteraw <masternode-tx-hash> <masternode-tx-index> <governance-hash> <vote-outcome> [yes|no|abstain] <time> <vote-sig>\n" "MNGOVERNANCEVOTEraw <masternode-tx-hash> <masternode-tx-index> <governance-hash> <vote-outcome> [yes|no|abstain] <time> <vote-sig>\n"
"Compile and relay a governance vote with provided external signature instead of signing vote internally\n" "Compile and relay a governance vote with provided external signature instead of signing vote internally\n"
); );

View File

@ -339,7 +339,7 @@ static const CRPCCommand vRPCCommands[] =
{ "dash", "masternodelist", &masternodelist, true }, { "dash", "masternodelist", &masternodelist, true },
{ "dash", "masternodebroadcast", &masternodebroadcast, true }, { "dash", "masternodebroadcast", &masternodebroadcast, true },
{ "dash", "mngovernance", &mngovernance, true }, { "dash", "mngovernance", &mngovernance, true },
{ "dash", "mngovernancevoteraw", &mngovernancevoteraw, true }, { "dash", "MNGOVERNANCEVOTEraw", &MNGOVERNANCEVOTEraw, true },
{ "dash", "mnsync", &mnsync, true }, { "dash", "mnsync", &mnsync, true },
{ "dash", "spork", &spork, true }, { "dash", "spork", &spork, true },
{ "dash", "getpoolinfo", &getpoolinfo, true }, { "dash", "getpoolinfo", &getpoolinfo, true },

View File

@ -265,7 +265,7 @@ extern UniValue masternode(const UniValue& params, bool fHelp);
extern UniValue masternodelist(const UniValue& params, bool fHelp); extern UniValue masternodelist(const UniValue& params, bool fHelp);
extern UniValue masternodebroadcast(const UniValue& params, bool fHelp); extern UniValue masternodebroadcast(const UniValue& params, bool fHelp);
extern UniValue mngovernance(const UniValue& params, bool fHelp); extern UniValue mngovernance(const UniValue& params, bool fHelp);
extern UniValue mngovernancevoteraw(const UniValue& params, bool fHelp); extern UniValue MNGOVERNANCEVOTEraw(const UniValue& params, bool fHelp);
extern UniValue mnsync(const UniValue& params, bool fHelp); extern UniValue mnsync(const UniValue& params, bool fHelp);
extern UniValue getblockcount(const UniValue& params, bool fHelp); // in rpcblockchain.cpp extern UniValue getblockcount(const UniValue& params, bool fHelp); // in rpcblockchain.cpp