Added IsValidLocallyMethod overload which returns masternode status flag

This commit is contained in:
Tim Flynn 2016-11-11 15:47:04 -05:00
parent a3277ea422
commit 35a45097ed
2 changed files with 11 additions and 0 deletions

View File

@ -1113,6 +1113,14 @@ void CGovernanceObject::UpdateLocalValidity(const CBlockIndex *pCurrentBlockInde
bool CGovernanceObject::IsValidLocally(const CBlockIndex* pindex, std::string& strError, bool fCheckCollateral)
{
bool fMissingMasternode = false;
return IsValidLocally(pindex, strError, fMissingMasternode, fCheckCollateral);
}
bool CGovernanceObject::IsValidLocally(const CBlockIndex* pindex, std::string& strError, bool& fMissingMasternode, bool fCheckCollateral)
{
fMissingMasternode = false;
if(!pindex) {
strError = "Tip is NULL";
return true;
@ -1147,6 +1155,7 @@ bool CGovernanceObject::IsValidLocally(const CBlockIndex* pindex, std::string& s
std::string strOutpoint = vinMasternode.prevout.ToStringShort();
masternode_info_t infoMn = mnodeman.GetMasternodeInfo(vinMasternode);
if(!infoMn.fInfoValid) {
fMissingMasternode = true;
strError = "Masternode not found: " + strOutpoint;
return false;
}

View File

@ -481,6 +481,8 @@ public:
bool IsValidLocally(const CBlockIndex* pindex, std::string& strError, bool fCheckCollateral);
bool IsValidLocally(const CBlockIndex* pindex, std::string& strError, bool& fMissingMasternode, bool fCheckCollateral);
/// Check the collateral transaction for the budget proposal/finalized budget
bool IsCollateralValid(std::string& strError);