Converting governance system
- Generic usage of governance objects - Added different voting types of signaling - Removed budget commands (projection, mesc -- see sentinel https://github.com/evan82/sentinel/blob/master/docs/example4.md) - Added various voting signaling mechanisms (origin funding, remove, valid, endorsed, milestones, outerstorage)
This commit is contained in:
parent
94f448d6fa
commit
fe5c4dd811
@ -23,9 +23,9 @@ In this transaction we prepare collateral for "_cool-project_". This proposal wi
|
||||
|
||||
**Warning: if you change any fields within this command, the collateral transaction will become invalid.**
|
||||
|
||||
Format: ```mnbudget prepare proposal-name url payment-count block-start dash-address monthly-payment-dash```
|
||||
Format: ```mngovernance prepare proposal-name url payment-count block-start dash-address monthly-payment-dash```
|
||||
|
||||
Example: ```mnbudget prepare cool-project http://www.cool-project/one.json 12 100000 y6R9oN12KnB9zydzTLc3LikD9cCjjQzYG7 1200 true```
|
||||
Example: ```mngovernance prepare cool-project http://www.cool-project/one.json 12 100000 y6R9oN12KnB9zydzTLc3LikD9cCjjQzYG7 1200 true```
|
||||
|
||||
Output: ```464a0eb70ea91c94295214df48c47baa72b3876cfb658744aaf863c7b5bf1ff0```
|
||||
|
||||
@ -36,9 +36,9 @@ This is the collateral hash, copy this output for the next step.
|
||||
|
||||
Now we can submit our proposal to the network.
|
||||
|
||||
Format: ```mnbudget submit proposal-name url payment-count block-start dash-address monthly-payment-dash fee-tx```
|
||||
Format: ```mngovernance submit proposal-name url payment-count block-start dash-address monthly-payment-dash fee-tx```
|
||||
|
||||
Example: ```mnbudget submit cool-project http://www.cool-project/one.json 12 100000 y6R9oN12KnB9zydzTLc3LikD9cCjjQzYG7 1200 464a0eb70ea91c94295214df48c47baa72b3876cfb658744aaf863c7b5bf1ff0```
|
||||
Example: ```mngovernance submit cool-project http://www.cool-project/one.json 12 100000 y6R9oN12KnB9zydzTLc3LikD9cCjjQzYG7 1200 464a0eb70ea91c94295214df48c47baa72b3876cfb658744aaf863c7b5bf1ff0```
|
||||
|
||||
Output : ```a2b29778ae82e45a973a94309ffa6aa2e2388b8f95b39ab3739f0078835f0491```
|
||||
|
||||
@ -49,9 +49,9 @@ This is your proposal hash, which other nodes will use to vote on it.
|
||||
|
||||
Double check your information.
|
||||
|
||||
Format: ```mnbudget getproposal proposal-hash```
|
||||
Format: ```mngovernance getproposal proposal-hash```
|
||||
|
||||
Example: ```mnbudget getproposal a2b29778ae82e45a973a94309ffa6aa2e2388b8f95b39ab3739f0078835f0491```
|
||||
Example: ```mngovernance getproposal a2b29778ae82e45a973a94309ffa6aa2e2388b8f95b39ab3739f0078835f0491```
|
||||

|
||||
```
|
||||
{
|
||||
@ -77,16 +77,16 @@ Example: ```mnbudget getproposal a2b29778ae82e45a973a94309ffa6aa2e2388b8f95b39ab
|
||||
|
||||
If everything looks correct, you can ask for votes from other masternodes. To vote on a proposal, load a wallet with _masternode.conf_ file. You do not need to access your cold wallet to vote for proposals.
|
||||
|
||||
Format: ```mnbudget vote proposal-hash [yes|no]```
|
||||
Format: ```mngovernance vote proposal-hash [yes|no]```
|
||||
|
||||
Example: ```mnbudget vote a2b29778ae82e45a973a94309ffa6aa2e2388b8f95b39ab3739f0078835f0491 yes```
|
||||
Example: ```mngovernance vote a2b29778ae82e45a973a94309ffa6aa2e2388b8f95b39ab3739f0078835f0491 yes```
|
||||
|
||||
4. Make it into the budget
|
||||
--
|
||||
|
||||
After you get enough votes, execute ```mnbudget projection``` to see if you made it into the budget. If you the budget was finalized at this moment which proposals would be in it. Note: Proposals must be active at least 1 day on the network and receive 10% of the masternode network in yes votes in order to qualify (E.g. if there is 3500 masternodes, you will need 350 yes votes.)
|
||||
After you get enough votes, execute ```mngovernance projection``` to see if you made it into the budget. If you the budget was finalized at this moment which proposals would be in it. Note: Proposals must be active at least 1 day on the network and receive 10% of the masternode network in yes votes in order to qualify (E.g. if there is 3500 masternodes, you will need 350 yes votes.)
|
||||
|
||||
```mnbudget projection```:
|
||||
```mngovernance projection```:
|
||||
```
|
||||
{
|
||||
"cool-project" : {
|
||||
@ -135,7 +135,7 @@ When block ```1000000``` is reached you'll receive a payment for ```1200``` DASH
|
||||
|
||||
The following RPC commands are supported:
|
||||
|
||||
- mnbudget "command"... ( "passphrase" )
|
||||
- mngovernance "command"... ( "passphrase" )
|
||||
- check - Scan proposals and remove invalid from proposals list
|
||||
- prepare - Prepare proposal by signing and creating tx
|
||||
- submit - Submit proposal to network
|
||||
|
@ -64,18 +64,6 @@
|
||||
* CValueOverride lvl, vo-type, status, status-error
|
||||
*/
|
||||
|
||||
class CDashNetwork;
|
||||
class CDashNetworkVariable;
|
||||
class CCategory;
|
||||
class CGroup;
|
||||
class CUser;
|
||||
class CCompany;
|
||||
class CProject;
|
||||
class CProjectReport;
|
||||
class CProjectMilestone;
|
||||
class CProposal;
|
||||
class CContract;
|
||||
class CValueOverride;
|
||||
|
||||
|
||||
/*
|
||||
@ -87,20 +75,6 @@ class CValueOverride;
|
||||
* -- Most of the values in these classes can be overriden
|
||||
*
|
||||
* CGovernanceNode (base)
|
||||
* -> CGovernanceObject (unimplementable)
|
||||
* -> CDashNetwork
|
||||
* -> CDashNetworkVariable
|
||||
* -> CValueOverride
|
||||
* -> CCategory
|
||||
* -> CGovernanceActor
|
||||
* -> CGroup
|
||||
* -> CUser
|
||||
* -> CCompany
|
||||
* -> DAO/DO/LLC/501c6/etc
|
||||
* -> CProject
|
||||
* -> CProjectReport
|
||||
* -> CProjectMilestone
|
||||
*
|
||||
*
|
||||
* TREE STRUCTURE
|
||||
* ===========================================
|
||||
|
54
src/governance-misc.h
Normal file
54
src/governance-misc.h
Normal file
@ -0,0 +1,54 @@
|
||||
// Copyright (c) 2014-2016 The Dash Core developers
|
||||
|
||||
// Distributed under the MIT/X11 software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
#ifndef GOVERANCE_MISC_H
|
||||
#define GOVERANCE_MISC_H
|
||||
|
||||
#include "main.h"
|
||||
#include "governance.h"
|
||||
#include "init.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
class CBudgetVote;
|
||||
|
||||
/**
|
||||
* Triggers and Settings - 12.2
|
||||
* -----------------------------------
|
||||
*
|
||||
* This allows the network fine grained control of the p2p side, including but not limited to:
|
||||
* - Which blocks are valid
|
||||
* - What it costs to do various things on the network
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// class CGovernanceTrigger
|
||||
// {
|
||||
// static &T IsBlockBanned(int n)
|
||||
// {
|
||||
|
||||
// }
|
||||
// };
|
||||
|
||||
// /*
|
||||
|
||||
|
||||
// */
|
||||
|
||||
// class CGovernanceSettings
|
||||
// {
|
||||
// template<typename T>
|
||||
// // strName=trigger, strParamater=ban-block ... obj= tigger.ban-block(args)
|
||||
// static &T GetSetting(std::string strName, &T networkDefault)
|
||||
// {
|
||||
// /*
|
||||
// - get setting from masternode network
|
||||
// */
|
||||
|
||||
// return networkDefault;
|
||||
// }
|
||||
// };
|
||||
|
||||
#endif
|
@ -1,16 +0,0 @@
|
||||
// Copyright (c) 2014-2016 The Dash Core developers
|
||||
|
||||
/*
|
||||
|
||||
|
||||
*/
|
||||
|
||||
class CGovernanceSettings
|
||||
{
|
||||
template<typename T>
|
||||
// strName=trigger, strParamater=ban-block ... obj= tigger.ban-block(args)
|
||||
static &T GetSetting(std::string strName)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -69,7 +69,7 @@ bool CBudgetVote::Sign(CKey& keyMasternode, CPubKey& pubKeyMasternode)
|
||||
bool CBudgetVote::IsValid(bool fSignatureCheck)
|
||||
{
|
||||
if(nTime > GetTime() + (60*60)){
|
||||
LogPrint("mnbudget", "CBudgetVote::IsValid() - vote is too far ahead of current time - %s - nTime %lli - Max Time %lli\n", GetHash().ToString(), nTime, GetTime() + (60*60));
|
||||
LogPrint("mngovernance", "CBudgetVote::IsValid() - vote is too far ahead of current time - %s - nTime %lli - Max Time %lli\n", GetHash().ToString(), nTime, GetTime() + (60*60));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ bool CBudgetVote::IsValid(bool fSignatureCheck)
|
||||
|
||||
if(pmn == NULL)
|
||||
{
|
||||
LogPrint("mnbudget", "CBudgetVote::IsValid() - Unknown Masternode - %s\n", vin.ToString());
|
||||
LogPrint("mngovernance", "CBudgetVote::IsValid() - Unknown Masternode - %s\n", vin.ToString());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ CGovernanceObject *CGovernanceManager::FindProposal(uint256 nHash)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
std::vector<CGovernanceObject*> CGovernanceManager::GetAllProposals()
|
||||
std::vector<CGovernanceObject*> CGovernanceManager::GetAllProposals(int64_t nTimeIn)
|
||||
{
|
||||
LOCK(cs);
|
||||
|
||||
@ -175,6 +175,10 @@ std::vector<CGovernanceObject*> CGovernanceManager::GetAllProposals()
|
||||
std::map<uint256, CGovernanceObject>::iterator it = mapProposals.begin();
|
||||
while(it != mapProposals.end())
|
||||
{
|
||||
if((*it).second.nTime < nTimeIn) {
|
||||
++it;
|
||||
continue;
|
||||
}
|
||||
(*it).second.CleanAndRemove(false);
|
||||
|
||||
CGovernanceObject* pbudgetProposal = &((*it).second);
|
||||
@ -291,18 +295,18 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, std::string& strCommand, C
|
||||
LOCK(cs_budget);
|
||||
|
||||
// todo - 12.1 - change to MNGOVERNANCEVOTESYNC
|
||||
if (strCommand == NetMsgType::MNBUDGETVOTESYNC) { //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::MNBUDGETVOTESYNC)) {
|
||||
if(pfrom->HasFulfilledRequest(NetMsgType::mngovernanceVOTESYNC)) {
|
||||
LogPrintf("mnvs - peer already asked me for the list\n");
|
||||
Misbehaving(pfrom->GetId(), 20);
|
||||
return;
|
||||
}
|
||||
pfrom->FulfilledRequest(NetMsgType::MNBUDGETVOTESYNC);
|
||||
pfrom->FulfilledRequest(NetMsgType::mngovernanceVOTESYNC);
|
||||
}
|
||||
}
|
||||
|
||||
@ -312,7 +316,7 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, std::string& strCommand, C
|
||||
}
|
||||
|
||||
// todo - 12.1 - change to MNGOVERNANCEPROPOSAL
|
||||
if (strCommand == NetMsgType::MNBUDGETPROPOSAL) { //Masternode Proposal
|
||||
if (strCommand == NetMsgType::mngovernancePROPOSAL) { //Masternode Proposal
|
||||
CGovernanceObject budgetProposalBroadcast;
|
||||
vRecv >> budgetProposalBroadcast;
|
||||
|
||||
@ -347,7 +351,7 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, std::string& strCommand, C
|
||||
}
|
||||
|
||||
// todo - 12.1 - change to MNGOVERNANCEVOTE
|
||||
if (strCommand == NetMsgType::MNBUDGETVOTE) { //Masternode Vote
|
||||
if (strCommand == NetMsgType::mngovernanceVOTE) { //Masternode Vote
|
||||
CBudgetVote vote;
|
||||
vRecv >> vote;
|
||||
vote.fValid = true;
|
||||
@ -359,7 +363,7 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, std::string& strCommand, C
|
||||
|
||||
CMasternode* pmn = mnodeman.Find(vote.vinMasternode);
|
||||
if(pmn == NULL) {
|
||||
LogPrint("mnbudget", "mvote - unknown masternode - vin: %s\n", vote.vinMasternode.ToString());
|
||||
LogPrint("mngovernance", "mvote - unknown masternode - vin: %s\n", vote.vinMasternode.ToString());
|
||||
mnodeman.AskForMN(pfrom, vote.vinMasternode);
|
||||
return;
|
||||
}
|
||||
@ -490,7 +494,7 @@ bool CGovernanceManager::UpdateProposal(CBudgetVote& vote, CNode* pfrom, std::st
|
||||
mapOrphanMasternodeBudgetVotes[vote.nParentHash] = vote;
|
||||
|
||||
if(!askedForSourceProposalOrBudget.count(vote.nParentHash)){
|
||||
pfrom->PushMessage(NetMsgType::MNBUDGETVOTESYNC, vote.nParentHash);
|
||||
pfrom->PushMessage(NetMsgType::mngovernanceVOTESYNC, vote.nParentHash);
|
||||
askedForSourceProposalOrBudget[vote.nParentHash] = GetTime();
|
||||
}
|
||||
}
|
||||
@ -513,12 +517,12 @@ bool CGovernanceManager::AddOrUpdateVote(CBudgetVote& vote, std::string& strErro
|
||||
if(mapVotes[hash2].count(hash)){
|
||||
if(mapVotes[hash2][hash].nTime > vote.nTime){
|
||||
strError = strprintf("new vote older than existing vote - %s", vote.GetHash().ToString());
|
||||
LogPrint("mnbudget", "CGovernanceObject::AddOrUpdateVote - %s\n", strError);
|
||||
LogPrint("mngovernance", "CGovernanceObject::AddOrUpdateVote - %s\n", strError);
|
||||
return false;
|
||||
}
|
||||
if(vote.nTime - mapVotes[hash2][hash].nTime < BUDGET_VOTE_UPDATE_MIN){
|
||||
strError = strprintf("time between votes is too soon - %s - %lli", vote.GetHash().ToString(), vote.nTime - mapVotes[hash2][hash].nTime);
|
||||
LogPrint("mnbudget", "CGovernanceObject::AddOrUpdateVote - %s\n", strError);
|
||||
LogPrint("mngovernance", "CGovernanceObject::AddOrUpdateVote - %s\n", strError);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -532,29 +536,17 @@ CGovernanceObject::CGovernanceObject()
|
||||
strName = "unknown";
|
||||
nStartTime = 0;
|
||||
nEndTime = 0;
|
||||
nAmount = 0;
|
||||
nTime = 0;
|
||||
fValid = true;
|
||||
}
|
||||
|
||||
CGovernanceObject::CGovernanceObject(const CGovernanceObject& other)
|
||||
{
|
||||
strName = other.strName;
|
||||
strURL = other.strURL;
|
||||
nStartTime = other.nStartTime;
|
||||
nEndTime = other.nEndTime;
|
||||
address = other.address;
|
||||
nAmount = other.nAmount;
|
||||
nTime = other.nTime;
|
||||
nFeeTXHash = other.nFeeTXHash;
|
||||
fValid = true;
|
||||
}
|
||||
|
||||
CGovernanceObject::CGovernanceObject(std::string strNameIn, std::string strURLIn, int64_t nStartTimeIn,
|
||||
int64_t nEndTimeIn, uint256 nFeeTXHashIn)
|
||||
CGovernanceObject::CGovernanceObject(uint256 nHashParentIn, int nPriorityIn, int nRevisionIn, int nTypeVersionIn, std::string strNameIn, int64_t nStartTimeIn, int64_t nEndTimeIn, uint256 nFeeTXHashIn)
|
||||
{
|
||||
nHashParent = nHashParentIn
|
||||
nPriority = nPriorityIn;
|
||||
nRevision = nRevisionIn;
|
||||
nTypeVersion = nTypeVersionIn;
|
||||
strName = strNameIn;
|
||||
strURL = strURLIn;
|
||||
nStartTime = nStartTimeIn;
|
||||
nEndTime = nEndTimeIn;
|
||||
nFeeTXHash = nFeeTXHashIn;
|
||||
@ -592,16 +584,6 @@ bool CGovernanceObject::IsValid(const CBlockIndex* pindex, std::string& strError
|
||||
return false;
|
||||
}
|
||||
|
||||
if(strURL.size() > 100) {
|
||||
strError = "Invalid proposal url, limit of 64 characters.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if(strURL != SanitizeString(strURL)) {
|
||||
strError = "Invalid proposal url, unsafe characters found.";
|
||||
return false;
|
||||
}
|
||||
|
||||
if(address == CScript()) {
|
||||
strError = "Invalid proposal Payment Address";
|
||||
return false;
|
||||
@ -741,7 +723,7 @@ std::string CGovernanceManager::ToString() const
|
||||
void CGovernanceManager::UpdatedBlockTip(const CBlockIndex *pindex)
|
||||
{
|
||||
pCurrentBlockIndex = pindex;
|
||||
LogPrint("mnbudget", "pCurrentBlockIndex->nHeight: %d\n", pCurrentBlockIndex->nHeight);
|
||||
LogPrint("mngovernance", "pCurrentBlockIndex->nHeight: %d\n", pCurrentBlockIndex->nHeight);
|
||||
|
||||
if(!fLiteMode && masternodeSync.RequestedMasternodeAssets > MASTERNODE_SYNC_LIST)
|
||||
NewBlock();
|
||||
|
@ -60,6 +60,8 @@ private:
|
||||
// Keep track of current block index
|
||||
const CBlockIndex *pCurrentBlockIndex;
|
||||
|
||||
int64_t nTimeLastDiff;
|
||||
|
||||
public:
|
||||
// critical section to protect the inner data structures
|
||||
mutable CCriticalSection cs;
|
||||
@ -139,6 +141,8 @@ public:
|
||||
}
|
||||
|
||||
void UpdatedBlockTip(const CBlockIndex *pindex);
|
||||
int64_t GetLastDiffTime() {return nTimeLastDiff;}
|
||||
void UpdateLastDiffTime(int64_t nTimeIn) {nTimeLastDiff=nTimeIn;}
|
||||
};
|
||||
|
||||
/**
|
||||
@ -166,7 +170,7 @@ public:
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
|
||||
//for syncing with other clients
|
||||
READWRITE(nType);
|
||||
READWRITE(LIMITED_STRING(strReg, 64));
|
||||
READWRITE(LIMITED_STRING(strReg, 255));
|
||||
}
|
||||
};
|
||||
|
||||
@ -184,25 +188,29 @@ private:
|
||||
CAmount nAlloted;
|
||||
|
||||
public:
|
||||
bool fValid;
|
||||
|
||||
uint256 nHashParent; //parent object, 0 is root
|
||||
int nPriority; //budget is sorted by this integer before funding votecount
|
||||
int nRevision; //object revision in the system
|
||||
int64_t nTime; //time this object was created
|
||||
|
||||
std::string strName; //org name, username, prop name, etc.
|
||||
int nStartTime;
|
||||
int nEndTime;
|
||||
CAmount nAmount; // 12.1 - remove
|
||||
int nPriority; //budget is sorted by this integer before funding votecount
|
||||
CScript address; //todo rename to addressOwner;
|
||||
int64_t nTime;
|
||||
CScript ownerAddress; //todo rename to addressOwner;
|
||||
uint256 nFeeTXHash;
|
||||
uint256 nHashParent; // 12.1 - remove
|
||||
|
||||
// caching
|
||||
bool fValid;
|
||||
uint256 nHash;
|
||||
|
||||
// Registers, these can be used for anything
|
||||
// -- check governance wiki for correct usage
|
||||
std::map<int, CGovernanceObjectRegister> mapRegister;
|
||||
|
||||
|
||||
CGovernanceObject();
|
||||
CGovernanceObject(const CGovernanceObject& other);
|
||||
CGovernanceObject(std::string strNameIn, int64_t nStartTimeIn, int64_t nEndTimeIn, uint256 nFeeTXHashIn);
|
||||
CGovernanceObject(uint256 nHashParentIn, int nPriorityIn, int nRevisionIn, int nTypeVersionIn, std::string strNameIn, int64_t nStartTimeIn, int64_t nEndTimeIn, uint256 nFeeTXHashIn);
|
||||
|
||||
bool HasMinimumRequiredSupport();
|
||||
bool IsValid(const CBlockIndex* pindex, std::string& strError, bool fCheckCollateral=true);
|
||||
@ -210,7 +218,6 @@ public:
|
||||
bool NetworkWillPay();
|
||||
|
||||
std::string GetName() {return strName; }
|
||||
std::string GetURL() {return strURL; }
|
||||
int GetStartTime() {return nStartTime;}
|
||||
int GetEndTime() {return nEndTime;}
|
||||
int IsActive(int64_t nTime) {return nTime > nStartTime && nTime < nEndTime;}
|
||||
@ -276,6 +283,19 @@ public:
|
||||
template <typename Stream, typename Operation>
|
||||
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion)
|
||||
{
|
||||
/*
|
||||
|
||||
uint256 nHashParent; //parent object, 0 is root
|
||||
int nPriority; //budget is sorted by this integer before funding votecount
|
||||
int nRevision; //object revision in the system
|
||||
int64_t nTime; //time this object was created
|
||||
|
||||
std::string strName; //org name, username, prop name, etc.
|
||||
int nStartTime;
|
||||
int nEndTime;
|
||||
CScript ownerAddress; //todo rename to addressOwner;
|
||||
uint256 nFeeTXHash;
|
||||
*/
|
||||
READWRITE(LIMITED_STRING(strName, 20));
|
||||
READWRITE(nTime);
|
||||
READWRITE(nStartTime);
|
||||
|
@ -511,7 +511,7 @@ std::string HelpMessage(HelpMessageMode mode)
|
||||
strUsage += HelpMessageOpt("-limitdescendantsize=<n>", strprintf("Do not accept transactions if any ancestor would have more than <n> kilobytes of in-mempool descendants (default: %u).", DEFAULT_DESCENDANT_SIZE_LIMIT));
|
||||
}
|
||||
string debugCategories = "addrman, alert, bench, coindb, db, lock, rand, rpc, selectcoins, mempool, mempoolrej, net, proxy, prune, http, libevent, tor, zmq, "
|
||||
"dash (or specifically: darksend, instantx, masternode, keepass, mnpayments, mnbudget)"; // Don't translate these and qt below
|
||||
"dash (or specifically: darksend, instantx, masternode, keepass, mnpayments, mngovernance)"; // Don't translate these and qt below
|
||||
if (mode == HMM_BITCOIN_QT)
|
||||
debugCategories += ", qt";
|
||||
strUsage += HelpMessageOpt("-debug=<category>", strprintf(_("Output debugging information (default: %u, supplying <category> is optional)"), 0) + ". " +
|
||||
|
@ -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::MNBUDGETVOTE, 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::MNBUDGETPROPOSAL, 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::MNBUDGETVOTESYNC) { //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::MNBUDGETVOTESYNC)) {
|
||||
if(pfrom->HasFulfilledRequest(NetMsgType::mngovernanceVOTESYNC)) {
|
||||
LogPrintf("mnvs - peer already asked me for the list\n");
|
||||
Misbehaving(pfrom->GetId(), 20);
|
||||
return;
|
||||
}
|
||||
pfrom->FulfilledRequest(NetMsgType::MNBUDGETVOTESYNC);
|
||||
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::MNBUDGETFINAL) { //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::MNBUDGETFINALVOTE) { //Finalized Budget Vote
|
||||
if (strCommand == NetMsgType::mngovernanceFINALVOTE) { //Finalized Budget Vote
|
||||
CBudgetVote vote;
|
||||
vRecv >> vote;
|
||||
vote.fValid = true;
|
||||
@ -212,7 +212,7 @@ void CBudgetManager::ProcessMessage(CNode* pfrom, std::string& strCommand, CData
|
||||
|
||||
CMasternode* pmn = mnodeman.Find(vote.vin);
|
||||
if(pmn == NULL) {
|
||||
LogPrint("mnbudget", "fbvote - unknown masternode - vin: %s\n", vote.vin.ToString());
|
||||
LogPrint("mngovernance", "fbvote - unknown masternode - vin: %s\n", vote.vin.ToString());
|
||||
mnodeman.AskForMN(pfrom, vote.vin);
|
||||
return;
|
||||
}
|
||||
@ -416,7 +416,7 @@ bool CBudgetManager::UpdateFinalizedBudget(CBudgetVote& vote, CNode* pfrom, std:
|
||||
mapOrphanFinalizedBudgetVotes[vote.nBudgetHash] = vote;
|
||||
|
||||
if(!askedForSourceProposalOrBudget.count(vote.nBudgetHash)){
|
||||
pfrom->PushMessage(NetMsgType::MNBUDGETVOTESYNC, vote.nBudgetHash);
|
||||
pfrom->PushMessage(NetMsgType::mngovernanceVOTESYNC, vote.nBudgetHash);
|
||||
askedForSourceProposalOrBudget[vote.nBudgetHash] = GetTime();
|
||||
}
|
||||
|
||||
@ -616,7 +616,7 @@ std::string CBudgetManager::ToString() const
|
||||
void CBudgetManager::UpdatedBlockTip(const CBlockIndex *pindex)
|
||||
{
|
||||
pCurrentBlockIndex = pindex;
|
||||
LogPrint("mnbudget", "pCurrentBlockIndex->nHeight: %d\n", pCurrentBlockIndex->nHeight);
|
||||
LogPrint("mngovernance", "pCurrentBlockIndex->nHeight: %d\n", pCurrentBlockIndex->nHeight);
|
||||
|
||||
if(!fLiteMode && masternodeSync.RequestedMasternodeAssets > MASTERNODE_SYNC_LIST)
|
||||
NewBlock();
|
||||
@ -662,12 +662,12 @@ bool CFinalizedBudget::AddOrUpdateVote(CBudgetVote& vote, std::string& strError)
|
||||
if(mapVotes.count(hash)){
|
||||
if(mapVotes[hash].nTime > vote.nTime){
|
||||
strError = strprintf("new vote older than existing vote - %s", vote.GetHash().ToString());
|
||||
LogPrint("mnbudget", "CFinalizedBudget::AddOrUpdateVote - %s\n", strError);
|
||||
LogPrint("mngovernance", "CFinalizedBudget::AddOrUpdateVote - %s\n", strError);
|
||||
return false;
|
||||
}
|
||||
if(vote.nTime - mapVotes[hash].nTime < BUDGET_VOTE_UPDATE_MIN){
|
||||
strError = strprintf("time between votes is too soon - %s - %lli", vote.GetHash().ToString(), vote.nTime - mapVotes[hash].nTime);
|
||||
LogPrint("mnbudget", "CFinalizedBudget::AddOrUpdateVote - %s\n", strError);
|
||||
LogPrint("mngovernance", "CFinalizedBudget::AddOrUpdateVote - %s\n", strError);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -1008,7 +1008,7 @@ bool CBudgetVote::Sign(CKey& keyMasternode, CPubKey& pubKeyMasternode)
|
||||
bool CBudgetVote::IsValid(bool fSignatureCheck)
|
||||
{
|
||||
if(nTime > GetTime() + (60*60)){
|
||||
LogPrint("mnbudget", "CBudgetVote::IsValid() - vote is too far ahead of current time - %s - nTime %lli - Max Time %lli\n", GetHash().ToString(), nTime, GetTime() + (60*60));
|
||||
LogPrint("mngovernance", "CBudgetVote::IsValid() - vote is too far ahead of current time - %s - nTime %lli - Max Time %lli\n", GetHash().ToString(), nTime, GetTime() + (60*60));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1016,7 +1016,7 @@ bool CBudgetVote::IsValid(bool fSignatureCheck)
|
||||
|
||||
if(pmn == NULL)
|
||||
{
|
||||
LogPrint("mnbudget", "CBudgetVote::IsValid() - Unknown Masternode\n");
|
||||
LogPrint("mngovernance", "CBudgetVote::IsValid() - Unknown Masternode\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -259,7 +259,7 @@ void CMasternodeSync::Process()
|
||||
int nMnCount = mnodeman.CountEnabled();
|
||||
pnode->PushMessage(NetMsgType::MNWINNERSSYNC, nMnCount); //sync payees
|
||||
uint256 n = uint256();
|
||||
pnode->PushMessage(NetMsgType::MNBUDGETVOTESYNC, 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 *MNBUDGETVOTESYNC="mnvs";
|
||||
const char *MNBUDGETVOTE="mvote";
|
||||
const char *MNBUDGETPROPOSAL="mprop";
|
||||
const char *MNBUDGETFINAL="fbs";
|
||||
const char *MNBUDGETFINALVOTE="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::MNBUDGETVOTE,
|
||||
NetMsgType::MNBUDGETPROPOSAL,
|
||||
NetMsgType::MNBUDGETFINAL,
|
||||
NetMsgType::MNBUDGETFINALVOTE,
|
||||
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::MNBUDGETVOTESYNC,
|
||||
NetMsgType::MNBUDGETVOTE,
|
||||
NetMsgType::MNBUDGETPROPOSAL,
|
||||
NetMsgType::MNBUDGETFINAL,
|
||||
NetMsgType::MNBUDGETFINALVOTE,
|
||||
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 *MNBUDGETVOTESYNC;
|
||||
extern const char *MNBUDGETVOTE;
|
||||
extern const char *MNBUDGETPROPOSAL;
|
||||
extern const char *MNBUDGETFINAL;
|
||||
extern const char *MNBUDGETFINALVOTE;
|
||||
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 },
|
||||
{ "mnbudgetvoteraw", 1 },
|
||||
{ "mnbudgetvoteraw", 4 },
|
||||
{ "mngovernancevoteraw", 1 },
|
||||
{ "mngovernancevoteraw", 4 },
|
||||
};
|
||||
|
||||
class CRPCConvertTable
|
||||
|
@ -34,16 +34,28 @@ using namespace std;
|
||||
*
|
||||
* command structure:
|
||||
*
|
||||
* governance prepare new nTypeIn nParentID "name" epoch-start epoch-end parameter1 parameter2 parameter3
|
||||
* For instructions on creating registers, see dashbrain
|
||||
*
|
||||
*
|
||||
* governance prepare new nTypeIn nParentID "name" epoch-start epoch-end register1 register2 register3
|
||||
* >> fee transaction hash
|
||||
*
|
||||
* governance submit fee-hash nTypeIn nParentID, "name", epoch-start, epoch-end, fee-hash, parameter1, parameter2, parameter3
|
||||
* governance submit fee-hash nTypeIn nParentID, "name", epoch-start, epoch-end, fee-hash, register1, register2, register3
|
||||
* >> governance object hash
|
||||
*
|
||||
* governance vote(-alias|many) type hash yes|no|abstain
|
||||
* >> success|failure
|
||||
*
|
||||
* governance list
|
||||
* >> flat data representation of the governance system
|
||||
* >> NOTE: this shouldn't be altered, we'll analyze the system outside of this project
|
||||
*
|
||||
* governance get hash
|
||||
* >> show one proposal
|
||||
*
|
||||
*/
|
||||
|
||||
UniValue mnbudget(const UniValue& params, bool fHelp)
|
||||
UniValue mngovernance(const UniValue& params, bool fHelp)
|
||||
{
|
||||
string strCommand;
|
||||
if (params.size() >= 1)
|
||||
@ -51,20 +63,16 @@ UniValue mnbudget(const UniValue& params, bool fHelp)
|
||||
|
||||
if (fHelp ||
|
||||
(strCommand != "vote-many" && strCommand != "vote-alias" && strCommand != "prepare" && strCommand != "submit" &&
|
||||
strCommand != "vote" && strCommand != "getvotes" && strCommand != "getproposal" &&
|
||||
strCommand != "list" && strCommand != "projection" && strCommand != "check"))
|
||||
strCommand != "vote" && strCommand != "get" && strCommand != "list" && strCommand != "diff"))
|
||||
throw runtime_error(
|
||||
"mnbudget \"command\"...\n"
|
||||
"mngovernance \"command\"...\n"
|
||||
"Manage proposals\n"
|
||||
"\nAvailable commands:\n"
|
||||
" check - Scan proposals and remove invalid from proposals list\n"
|
||||
" prepare - Prepare proposal by signing and creating tx\n"
|
||||
" submit - Submit proposal to network\n"
|
||||
" getproposalhash - Get proposal hash(es) by proposal name\n"
|
||||
" getproposal - Show proposal\n"
|
||||
" getvotes - Show detailed votes list for proposal\n"
|
||||
" get - Get proposal hash(es) by proposal name\n"
|
||||
" list - List all proposals\n"
|
||||
" projection - Show the projection of which proposals will be paid the next cycle\n"
|
||||
" diff - List differences since last diff\n"
|
||||
" vote - Vote on a proposal by single masternode (using dash.conf setup)\n"
|
||||
" vote-many - Vote on a proposal by all masternodes (using masternode.conf setup)\n"
|
||||
" vote-alias - Vote on a proposal by alias\n"
|
||||
@ -73,7 +81,7 @@ UniValue mnbudget(const UniValue& params, bool fHelp)
|
||||
if(strCommand == "prepare")
|
||||
{
|
||||
if (params.size() != 7)
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Correct usage is 'mnbudget prepare <proposal-name> <url> <payment-count> <block-start> <dash-address> <monthly-payment-dash>'");
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Correct usage is 'mngovernance prepare <proposal-name> <url> <payment-count> <block-start> <dash-address> <monthly-payment-dash>'");
|
||||
|
||||
int nBlockMin = 0;
|
||||
LOCK(cs_main);
|
||||
@ -83,15 +91,10 @@ UniValue mnbudget(const UniValue& params, bool fHelp)
|
||||
mnEntries = masternodeConfig.getEntries();
|
||||
|
||||
std::string strName = SanitizeString(params[1].get_str());
|
||||
std::string strURL = SanitizeString(params[2].get_str());
|
||||
int nBlockStart = params[4].get_int();
|
||||
|
||||
//set block min
|
||||
if(pindex != NULL) nBlockMin = pindex->nHeight;
|
||||
|
||||
if(nBlockStart < nBlockMin)
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid block start, must be more than current height.");
|
||||
|
||||
CBitcoinAddress address(params[5].get_str());
|
||||
if (!address.IsValid())
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Dash address");
|
||||
@ -99,7 +102,7 @@ UniValue mnbudget(const UniValue& params, bool fHelp)
|
||||
//*************************************************************************
|
||||
|
||||
// create transaction 15 minutes into the future, to allow for confirmation time
|
||||
CGovernanceObject budgetProposalBroadcast(strName, strURL, GetTime(), 253370764800, uint256());
|
||||
CGovernanceObject budgetProposalBroadcast(strName, GetTime(), 253370764800, uint256());
|
||||
|
||||
std::string strError = "";
|
||||
if(!budgetProposalBroadcast.IsValid(pindex, strError, false))
|
||||
@ -121,7 +124,7 @@ UniValue mnbudget(const UniValue& params, bool fHelp)
|
||||
if(strCommand == "submit")
|
||||
{
|
||||
if (params.size() != 8)
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Correct usage is 'mnbudget submit <proposal-name> <url> <payment-count> <block-start> <dash-address> <monthly-payment-dash> <fee-tx>'");
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Correct usage is 'mngovernance submit <proposal-name> <url> <payment-count> <block-start> <dash-address> <monthly-payment-dash> <fee-tx>'");
|
||||
|
||||
if(!masternodeSync.IsBlockchainSynced()){
|
||||
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Must wait for client to sync with masternode network. Try again in a minute or so.");
|
||||
@ -135,7 +138,6 @@ UniValue mnbudget(const UniValue& params, bool fHelp)
|
||||
mnEntries = masternodeConfig.getEntries();
|
||||
|
||||
std::string strName = SanitizeString(params[1].get_str());
|
||||
std::string strURL = SanitizeString(params[2].get_str());
|
||||
|
||||
//set block min
|
||||
if(pindex != NULL) nBlockMin = pindex->nHeight;
|
||||
@ -143,7 +145,7 @@ UniValue mnbudget(const UniValue& params, bool fHelp)
|
||||
// create new governance object
|
||||
|
||||
uint256 hash = ParseHashV(params[7], "Proposal hash");
|
||||
CGovernanceObject budgetProposalBroadcast(strName, strURL, GetTime(), 253370764800, uint256());
|
||||
CGovernanceObject budgetProposalBroadcast(strName, GetTime(), 253370764800, uint256());
|
||||
|
||||
std::string strError = "";
|
||||
|
||||
@ -167,7 +169,7 @@ UniValue mnbudget(const UniValue& params, bool fHelp)
|
||||
if(strCommand == "vote-many")
|
||||
{
|
||||
if(params.size() != 3)
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Correct usage is 'mnbudget vote-many <proposal-hash> [yes|no]'");
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Correct usage is 'mngovernance vote-many <proposal-hash> [yes|no]'");
|
||||
|
||||
uint256 hash;
|
||||
std::string strVote;
|
||||
@ -254,7 +256,7 @@ UniValue mnbudget(const UniValue& params, bool fHelp)
|
||||
if(strCommand == "vote-alias")
|
||||
{
|
||||
if(params.size() != 4)
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Correct usage is 'mnbudget vote-alias <proposal-hash> [yes|no] <alias-name>'");
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Correct usage is 'mngovernance vote-alias <proposal-hash> [yes|no] <alias-name>'");
|
||||
|
||||
uint256 hash;
|
||||
std::string strVote;
|
||||
@ -345,7 +347,7 @@ UniValue mnbudget(const UniValue& params, bool fHelp)
|
||||
if(strCommand == "vote")
|
||||
{
|
||||
if (params.size() != 3)
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Correct usage is 'mnbudget vote <proposal-hash> [yes|no]'");
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Correct usage is 'mngovernance vote <proposal-hash> [yes|no]'");
|
||||
|
||||
uint256 hash = ParseHashV(params[1], "Proposal hash");
|
||||
std::string strVote = params[2].get_str();
|
||||
@ -385,10 +387,10 @@ UniValue mnbudget(const UniValue& params, bool fHelp)
|
||||
}
|
||||
}
|
||||
|
||||
if(strCommand == "list")
|
||||
if(strCommand == "list" || strCommand == "diff")
|
||||
{
|
||||
if (params.size() > 2)
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Correct usage is 'mnbudget list [valid]'");
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Correct usage is 'mngovernance list [valid]'");
|
||||
|
||||
std::string strShow = "valid";
|
||||
if (params.size() == 2) strShow = params[1].get_str();
|
||||
@ -401,14 +403,14 @@ UniValue mnbudget(const UniValue& params, bool fHelp)
|
||||
pindex = chainActive.Tip();
|
||||
}
|
||||
|
||||
std::vector<CGovernanceObject*> winningProps = governance.GetAllProposals();
|
||||
std::vector<CGovernanceObject*> winningProps = governance.GetAllProposals(governance.GetLastDiffTime());
|
||||
governance.UpdateLastDiffTime(GetTime());
|
||||
BOOST_FOREACH(CGovernanceObject* pbudgetProposal, winningProps)
|
||||
{
|
||||
if(strShow == "valid" && !pbudgetProposal->fValid) continue;
|
||||
|
||||
UniValue bObj(UniValue::VOBJ);
|
||||
bObj.push_back(Pair("Name", pbudgetProposal->GetName()));
|
||||
bObj.push_back(Pair("URL", pbudgetProposal->GetURL()));
|
||||
bObj.push_back(Pair("Hash", pbudgetProposal->GetHash().ToString()));
|
||||
bObj.push_back(Pair("FeeTXHash", pbudgetProposal->nFeeTXHash.ToString()));
|
||||
bObj.push_back(Pair("StartTime", (int64_t)pbudgetProposal->GetStartTime()));
|
||||
@ -433,7 +435,7 @@ UniValue mnbudget(const UniValue& params, bool fHelp)
|
||||
if(strCommand == "getproposal")
|
||||
{
|
||||
if (params.size() != 2)
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Correct usage is 'mnbudget getproposal <proposal-hash>'");
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Correct usage is 'mngovernance getproposal <proposal-hash>'");
|
||||
|
||||
uint256 hash = ParseHashV(params[1], "Proposal hash");
|
||||
|
||||
@ -453,7 +455,6 @@ UniValue mnbudget(const UniValue& params, bool fHelp)
|
||||
obj.push_back(Pair("Name", pbudgetProposal->GetName()));
|
||||
obj.push_back(Pair("Hash", pbudgetProposal->GetHash().ToString()));
|
||||
obj.push_back(Pair("FeeTXHash", pbudgetProposal->nFeeTXHash.ToString()));
|
||||
obj.push_back(Pair("URL", pbudgetProposal->GetURL()));
|
||||
obj.push_back(Pair("StartTime", (int64_t)pbudgetProposal->GetStartTime()));
|
||||
obj.push_back(Pair("EndTime", (int64_t)pbudgetProposal->GetEndTime()));
|
||||
obj.push_back(Pair("AbsoluteYesCount", (int64_t)pbudgetProposal->GetYesCount()-(int64_t)pbudgetProposal->GetNoCount()));
|
||||
@ -472,7 +473,7 @@ UniValue mnbudget(const UniValue& params, bool fHelp)
|
||||
if(strCommand == "getvotes")
|
||||
{
|
||||
if (params.size() != 2)
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Correct usage is 'mnbudget getvotes <proposal-hash>'");
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Correct usage is 'mngovernance getvotes <proposal-hash>'");
|
||||
|
||||
uint256 hash = ParseHashV(params[1], "Proposal hash");
|
||||
|
||||
@ -505,11 +506,11 @@ UniValue mnbudget(const UniValue& params, bool fHelp)
|
||||
return NullUniValue;
|
||||
}
|
||||
|
||||
UniValue mnbudgetvoteraw(const UniValue& params, bool fHelp)
|
||||
UniValue mngovernancevoteraw(const UniValue& params, bool fHelp)
|
||||
{
|
||||
if (fHelp || params.size() != 6)
|
||||
throw runtime_error(
|
||||
"mnbudgetvoteraw <masternode-tx-hash> <masternode-tx-index> <proposal-hash> [yes|no] <time> <vote-sig>\n"
|
||||
"mngovernancevoteraw <masternode-tx-hash> <masternode-tx-index> <proposal-hash> [yes|no] <time> <vote-sig>\n"
|
||||
"Compile and relay a proposal vote with provided external signature instead of signing vote internally\n"
|
||||
);
|
||||
|
||||
|
@ -120,7 +120,7 @@ UniValue debug(const UniValue& params, bool fHelp)
|
||||
throw runtime_error(
|
||||
"debug ( 0|1|addrman|alert|bench|coindb|db|lock|rand|rpc|selectcoins|mempool"
|
||||
"|mempoolrej|net|proxy|prune|http|libevent|tor|zmq|"
|
||||
"dash|darksend|instantx|masternode|keepass|mnpayments|mnbudget )\n"
|
||||
"dash|darksend|instantx|masternode|keepass|mnpayments|mngovernance )\n"
|
||||
"Change debug category on the fly. Specify single category or use comma to specify many.\n"
|
||||
"\nExamples:\n"
|
||||
+ HelpExampleCli("debug", "dash")
|
||||
|
@ -338,8 +338,8 @@ static const CRPCCommand vRPCCommands[] =
|
||||
{ "dash", "masternode", &masternode, true },
|
||||
{ "dash", "masternodelist", &masternodelist, true },
|
||||
{ "dash", "masternodebroadcast", &masternodebroadcast, true },
|
||||
{ "dash", "mnbudget", &mnbudget, true },
|
||||
{ "dash", "mnbudgetvoteraw", &mnbudgetvoteraw, true },
|
||||
{ "dash", "mngovernance", &mngovernance, true },
|
||||
{ "dash", "mngovernancevoteraw", &mngovernancevoteraw, true },
|
||||
{ "dash", "mnsync", &mnsync, true },
|
||||
{ "dash", "spork", &spork, true },
|
||||
{ "dash", "getpoolinfo", &getpoolinfo, true },
|
||||
|
@ -264,8 +264,8 @@ extern UniValue spork(const UniValue& params, bool fHelp);
|
||||
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 mnbudget(const UniValue& params, bool fHelp);
|
||||
extern UniValue mnbudgetvoteraw(const UniValue& params, bool fHelp);
|
||||
extern UniValue mngovernance(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
|
||||
|
@ -283,7 +283,7 @@ bool LogAcceptCategory(const char* category)
|
||||
ptrCategory->insert(string("masternode"));
|
||||
ptrCategory->insert(string("keepass"));
|
||||
ptrCategory->insert(string("mnpayments"));
|
||||
ptrCategory->insert(string("mnbudget"));
|
||||
ptrCategory->insert(string("mngovernance"));
|
||||
}
|
||||
}
|
||||
const set<string>& setCategories = *ptrCategory.get();
|
||||
|
Loading…
Reference in New Issue
Block a user