From 15cf414967bf395e902fd61a2984b433724b5bdc Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Wed, 30 Nov 2016 05:33:47 +0400 Subject: [PATCH] Slightly improve/cleanup log output (#1174) --- src/activemasternode.cpp | 2 +- src/governance.cpp | 10 +++++++--- src/masternode.cpp | 10 +++++----- src/masternodeman.cpp | 2 +- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/activemasternode.cpp b/src/activemasternode.cpp index 05efe914c..e539e61fc 100644 --- a/src/activemasternode.cpp +++ b/src/activemasternode.cpp @@ -174,7 +174,7 @@ void CActiveMasternode::ManageStateInitial() } if(pwalletMain->GetBalance() < 1000*COIN) { - LogPrintf("CActiveMasternode::ManageStateInitial -- %s: Wallet balance is < 1000 DASH", GetStateString()); + LogPrintf("CActiveMasternode::ManageStateInitial -- %s: Wallet balance is < 1000 DASH\n", GetStateString()); return; } diff --git a/src/governance.cpp b/src/governance.cpp index 511f67793..ebc5ba06c 100644 --- a/src/governance.cpp +++ b/src/governance.cpp @@ -296,7 +296,7 @@ bool CGovernanceManager::AddGovernanceObject(CGovernanceObject& govobj) // IF WE HAVE THIS OBJECT ALREADY, WE DON'T WANT ANOTHER COPY if(mapObjects.count(nHash)) { - LogPrintf("CGovernanceManager::AddGovernanceObject -- already have governance object - %s\n", strError); + LogPrintf("CGovernanceManager::AddGovernanceObject -- already have governance object %s\n", nHash.ToString()); return false; } @@ -873,8 +873,12 @@ void CGovernanceManager::AddCachedTriggers() void CGovernanceManager::InitOnLoad() { LOCK(cs); + int64_t nStart = GetTimeMillis(); + LogPrintf("Preparing masternode indexes and governance triggers...\n"); RebuildIndexes(); AddCachedTriggers(); + LogPrintf("Masternode indexes and governance triggers prepared %dms\n", GetTimeMillis() - nStart); + LogPrintf(" %s\n", ToString()); } std::string CGovernanceManager::ToString() const @@ -882,8 +886,8 @@ std::string CGovernanceManager::ToString() const std::ostringstream info; info << "Governance Objects: " << (int)mapObjects.size() << - ", Seen Budgets : " << (int)mapSeenGovernanceObjects.size() << - ", Vote Count : " << (int)mapVoteToObject.GetSize(); + " (Seen: " << (int)mapSeenGovernanceObjects.size() << + "), Vote Count: " << (int)mapVoteToObject.GetSize(); return info.str(); } diff --git a/src/masternode.cpp b/src/masternode.cpp index 7f1285405..160325e6d 100644 --- a/src/masternode.cpp +++ b/src/masternode.cpp @@ -168,16 +168,16 @@ void CMasternode::Check(bool fForce) static int64_t nTimeStart = GetTime(); - LogPrint("masternode", "CMasternode::Check start -- vin %s\n", vin.prevout.ToStringShort()); - - //once spent, stop doing the checks - if(nActiveState == MASTERNODE_OUTPOINT_SPENT) return; - if(ShutdownRequested()) return; if(!fForce && (GetTime() - nTimeLastChecked < MASTERNODE_CHECK_SECONDS)) return; nTimeLastChecked = GetTime(); + LogPrint("masternode", "CMasternode::Check -- Masternode %s is in %s state\n", vin.prevout.ToStringShort(), GetStateString()); + + //once spent, stop doing the checks + if(nActiveState == MASTERNODE_OUTPOINT_SPENT) return; + int nHeight = 0; if(!fUnitTest) { TRY_LOCK(cs_main, lockMain); diff --git a/src/masternodeman.cpp b/src/masternodeman.cpp index 5a8ed2916..e03ee4ec8 100644 --- a/src/masternodeman.cpp +++ b/src/masternodeman.cpp @@ -1136,7 +1136,7 @@ void CMasternodeMan::ProcessVerifyReply(CNode* pnode, CMasternodeVerification& m LogPrint("masternode", "CMasternodeMan::ProcessVerifyBroadcast -- increased PoSe ban score for %s addr %s, new score %d\n", prealMasternode->vin.prevout.ToStringShort(), pnode->addr.ToString(), pmn->nPoSeBanScore); } - LogPrintf("CMasternodeMan::ProcessVerifyBroadcast -- PoSe score incresed for %d fake masternodes, addr %s\n", + LogPrintf("CMasternodeMan::ProcessVerifyBroadcast -- PoSe score increased for %d fake masternodes, addr %s\n", (int)vpMasternodesToBan.size(), pnode->addr.ToString()); } }