mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
fixed greedy find/replace (opps)
This commit is contained in:
parent
f2de437f05
commit
aee86618cd
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -111,8 +111,8 @@ static const CRPCConvertParam vRPCConvertParams[] =
|
||||
{ "setban", 2 },
|
||||
{ "setban", 3 },
|
||||
{ "spork", 1 },
|
||||
{ "mngovernancevoteraw", 1 },
|
||||
{ "mngovernancevoteraw", 4 },
|
||||
{ "MNGOVERNANCEVOTEraw", 1 },
|
||||
{ "MNGOVERNANCEVOTEraw", 4 },
|
||||
};
|
||||
|
||||
class CRPCConvertTable
|
||||
|
@ -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 <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"
|
||||
);
|
||||
|
||||
|
@ -339,7 +339,7 @@ static const CRPCCommand vRPCCommands[] =
|
||||
{ "dash", "masternodelist", &masternodelist, true },
|
||||
{ "dash", "masternodebroadcast", &masternodebroadcast, true },
|
||||
{ "dash", "mngovernance", &mngovernance, true },
|
||||
{ "dash", "mngovernancevoteraw", &mngovernancevoteraw, true },
|
||||
{ "dash", "MNGOVERNANCEVOTEraw", &MNGOVERNANCEVOTEraw, true },
|
||||
{ "dash", "mnsync", &mnsync, true },
|
||||
{ "dash", "spork", &spork, true },
|
||||
{ "dash", "getpoolinfo", &getpoolinfo, true },
|
||||
|
@ -265,7 +265,7 @@ extern UniValue masternode(const UniValue& params, bool fHelp);
|
||||
extern UniValue masternodelist(const UniValue& params, bool fHelp);
|
||||
extern UniValue masternodebroadcast(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 getblockcount(const UniValue& params, bool fHelp); // in rpcblockchain.cpp
|
||||
|
Loading…
Reference in New Issue
Block a user