Improve governance debugging information (#1221)

* Add missing MN vin to error message for missing masternodes

* Added creation time and masternode vin to gobject output
This commit is contained in:
Tim Flynn 2016-12-21 22:20:05 -05:00 committed by UdjinM6
parent 1c6c0d8b7e
commit c438e74563
2 changed files with 11 additions and 1 deletions

View File

@ -177,7 +177,7 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, std::string& strCommand, C
if(fMasternodeMissing) { if(fMasternodeMissing) {
mapMasternodeOrphanObjects.insert(std::make_pair(nHash, object_time_pair_t(govobj, GetAdjustedTime() + GOVERNANCE_ORPHAN_EXPIRATION_TIME))); mapMasternodeOrphanObjects.insert(std::make_pair(nHash, object_time_pair_t(govobj, GetAdjustedTime() + GOVERNANCE_ORPHAN_EXPIRATION_TIME)));
LogPrint("gobject", "MNGOVERNANCEOBJECT -- Missing masternode for: %s\n", strHash); LogPrintf("MNGOVERNANCEOBJECT -- Missing masternode for: %s, strError = %s\n", strHash, strError);
// fIsValid must also be false here so we will return early in the next if block // fIsValid must also be false here so we will return early in the next if block
} }
if(!fIsValid) { if(!fIsValid) {

View File

@ -592,6 +592,11 @@ UniValue gobject(const UniValue& params, bool fHelp)
bObj.push_back(Pair("DataString", pGovObj->GetDataAsString())); bObj.push_back(Pair("DataString", pGovObj->GetDataAsString()));
bObj.push_back(Pair("Hash", pGovObj->GetHash().ToString())); bObj.push_back(Pair("Hash", pGovObj->GetHash().ToString()));
bObj.push_back(Pair("CollateralHash", pGovObj->GetCollateralHash().ToString())); bObj.push_back(Pair("CollateralHash", pGovObj->GetCollateralHash().ToString()));
bObj.push_back(Pair("CreationTime", pGovObj->GetCreationTime()));
const CTxIn& masternodeVin = pGovObj->GetMasternodeVin();
if(masternodeVin != CTxIn()) {
bObj.push_back(Pair("SigningMasternode", masternodeVin.prevout.ToStringShort()));
}
// REPORT STATUS FOR FUNDING VOTES SPECIFICALLY // REPORT STATUS FOR FUNDING VOTES SPECIFICALLY
bObj.push_back(Pair("AbsoluteYesCount", pGovObj->GetAbsoluteYesCount(VOTE_SIGNAL_FUNDING))); bObj.push_back(Pair("AbsoluteYesCount", pGovObj->GetAbsoluteYesCount(VOTE_SIGNAL_FUNDING)));
@ -638,6 +643,11 @@ UniValue gobject(const UniValue& params, bool fHelp)
objResult.push_back(Pair("DataString", pGovObj->GetDataAsString())); objResult.push_back(Pair("DataString", pGovObj->GetDataAsString()));
objResult.push_back(Pair("Hash", pGovObj->GetHash().ToString())); objResult.push_back(Pair("Hash", pGovObj->GetHash().ToString()));
objResult.push_back(Pair("CollateralHash", pGovObj->GetCollateralHash().ToString())); objResult.push_back(Pair("CollateralHash", pGovObj->GetCollateralHash().ToString()));
objResult.push_back(Pair("CreationTime", pGovObj->GetCreationTime()));
const CTxIn& masternodeVin = pGovObj->GetMasternodeVin();
if(masternodeVin != CTxIn()) {
objResult.push_back(Pair("SigningMasternode", masternodeVin.prevout.ToStringShort()));
}
// SHOW (MUCH MORE) INFORMATION ABOUT VOTES FOR GOVERNANCE OBJECT (THAN LIST/DIFF ABOVE) // SHOW (MUCH MORE) INFORMATION ABOUT VOTES FOR GOVERNANCE OBJECT (THAN LIST/DIFF ABOVE)
// -- FUNDING VOTING RESULTS // -- FUNDING VOTING RESULTS