Governance bug fix (#998)
* Added more specific error message about attempts to submit superblocks by non-masternodes * Fixed governance object validation bug * Fixed logic bug in governance object submission
This commit is contained in:
parent
740d1e0b1e
commit
d81e729b0a
@ -956,7 +956,7 @@ bool CGovernanceObject::IsValidLocally(const CBlockIndex* pindex, std::string& s
|
||||
if(fCheckCollateral) {
|
||||
if(nObjectType == GOVERNANCE_OBJECT_TRIGGER) {
|
||||
CMasternode mn;
|
||||
if(mnodeman.Get(pubkeyMasternode, mn)) {
|
||||
if(!mnodeman.Get(pubkeyMasternode, mn)) {
|
||||
strError = "Masternode not found";
|
||||
return false;
|
||||
}
|
||||
|
@ -186,9 +186,14 @@ UniValue gobject(const UniValue& params, bool fHelp)
|
||||
<< endl; );
|
||||
|
||||
// Attempt to sign triggers if we are a MN
|
||||
if((govobj.GetObjectType() == GOVERNANCE_OBJECT_TRIGGER) && mnFound) {
|
||||
govobj.SetMasternodeInfo(mn.vin, activeMasternode.pubKeyMasternode);
|
||||
govobj.Sign(activeMasternode.keyMasternode);
|
||||
if(govobj.GetObjectType() == GOVERNANCE_OBJECT_TRIGGER) {
|
||||
if(mnFound) {
|
||||
govobj.SetMasternodeInfo(mn.vin, activeMasternode.pubKeyMasternode);
|
||||
govobj.Sign(activeMasternode.keyMasternode);
|
||||
}
|
||||
else {
|
||||
throw JSONRPCError(RPC_INTERNAL_ERROR, "Only valid masternodes can submit this type of object");
|
||||
}
|
||||
}
|
||||
|
||||
std::string strError = "";
|
||||
|
Loading…
Reference in New Issue
Block a user