Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bunch of mostly trivial tweaks/fixes #2889

Merged
merged 8 commits into from
Apr 30, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/evo/simplifiedmns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ uint256 CSimplifiedMNListEntry::CalcHash() const

std::string CSimplifiedMNListEntry::ToString() const
{
return strprintf("CSimplifiedMNListEntry(proRegTxHash=%s, confirmedHash=%s, service=%s, pubKeyOperator=%s, votingAddress=%s, isValie=%d)",
return strprintf("CSimplifiedMNListEntry(proRegTxHash=%s, confirmedHash=%s, service=%s, pubKeyOperator=%s, votingAddress=%s, isValid=%d)",
proRegTxHash.ToString(), confirmedHash.ToString(), service.ToString(false), pubKeyOperator.ToString(), CBitcoinAddress(keyIDVoting).ToString(), isValid);
}

Expand Down
6 changes: 3 additions & 3 deletions src/governance-object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,14 +495,14 @@ bool CGovernanceObject::IsValidLocally(std::string& strError, bool& fMissingMast
std::string strOutpoint = masternodeOutpoint.ToStringShort();
auto dmn = mnList.GetMNByCollateral(masternodeOutpoint);
if (!dmn) {
strError = "Failed to find Masternode by UTXO, missing masternode=" + strOutpoint + "\n";
strError = "Failed to find Masternode by UTXO, missing masternode=" + strOutpoint;
return false;
}
if (!mnList.IsMNValid(dmn)) {
if (mnList.IsMNPoSeBanned(dmn)) {
strError = "Masternode is POSE_BANNED, masternode=" + strOutpoint + "\n";
strError = "Masternode is POSE_BANNED, masternode=" + strOutpoint;
} else {
strError = "Masternode is invalid for unknown reason, masternode=" + strOutpoint + "\n";
strError = "Masternode is invalid for unknown reason, masternode=" + strOutpoint;
}
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions src/governance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, const std::string& strComm

if (fRateCheckBypassed && (fIsValid || fMasternodeMissing)) {
if (!MasternodeRateCheck(govobj, true)) {
LogPrintf("MNGOVERNANCEOBJECT -- masternode rate check failed (after signature verification) - %s - (current block height %d) \n", strHash, nCachedBlockHeight);
LogPrintf("MNGOVERNANCEOBJECT -- masternode rate check failed (after signature verification) - %s - (current block height %d)\n", strHash, nCachedBlockHeight);
return;
}
}
Expand Down Expand Up @@ -445,7 +445,7 @@ void CGovernanceManager::UpdateCachesAndClean()
if (pObj->GetObjectType() == GOVERNANCE_OBJECT_PROPOSAL) {
CProposalValidator validator(pObj->GetDataAsHexString(), true);
if (!validator.Validate()) {
LogPrintf("CGovernanceManager::UpdateCachesAndClean -- set for deletion expired obj %s\n", (*it).first.ToString());
LogPrintf("CGovernanceManager::UpdateCachesAndClean -- set for deletion expired obj %s\n", strHash);
pObj->fCachedDelete = true;
if (pObj->nDeletionTime == 0) {
pObj->nDeletionTime = nNow;
Expand Down
2 changes: 1 addition & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
// scan for better chains in the block chain database, that are not yet connected in the active best chain
CValidationState state;
if (!ActivateBestChain(state, chainparams)) {
LogPrintf("Failed to connect best block");
LogPrintf("Failed to connect best block (%s)\n", FormatStateMessage(state));
StartShutdown();
}

Expand Down
1 change: 1 addition & 0 deletions src/llmq/quorums_blockprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ bool CQuorumBlockProcessor::GetCommitmentsFromBlock(const CBlock& block, const C
return state.DoS(100, false, REJECT_INVALID, "bad-qc-dup");
}

LogPrint("llmq", "CQuorumBlockProcessor::%s -- commitment found in block %s tx %s\n", __func__, block.GetHash().ToString(), tx->GetHash().ToString());
codablock marked this conversation as resolved.
Show resolved Hide resolved
ret.emplace((Consensus::LLMQType)qc.commitment.llmqType, std::move(qc.commitment));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/llmq/quorums_chainlocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ void CChainLocksHandler::TrySignChainTip()
auto it = blockTxs.find(pindexWalk->GetBlockHash());
if (it == blockTxs.end()) {
// this should actually not happen as NewPoWValidBlock should have been called before
LogPrintf("CChainLocksHandler::%s -- blockTxs for %s not found\n", __func__,
LogPrint("chainlocks", "CChainLocksHandler::%s -- blockTxs for %s not found\n", __func__,
pindexWalk->GetBlockHash().ToString());
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ void CConnman::AcceptConnection(const ListenSocket& hListenSocket) {

// don't accept incoming connections until fully synced
if(fMasternodeMode && !masternodeSync.IsSynced()) {
LogPrintf("AcceptConnection -- masternode is not synced yet, skipping inbound connection attempt\n");
LogPrint("masternode", "AcceptConnection -- masternode is not synced yet, skipping inbound connection attempt\n");
codablock marked this conversation as resolved.
Show resolved Hide resolved
CloseSocket(hSocket);
return;
}
Expand Down
21 changes: 14 additions & 7 deletions src/privatesend-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -864,13 +864,20 @@ bool CPrivateSendClientSession::DoAutomaticDenominating(CConnman& connman, bool
CAmount nBalanceDenominatedUnconf = pwalletMain->GetDenominatedBalance(true);
CAmount nBalanceDenominated = nBalanceDenominatedConf + nBalanceDenominatedUnconf;

LogPrint("privatesend", "CPrivateSendClientSession::DoAutomaticDenominating -- nValueMin: %f, nBalanceNeedsAnonymized: %f, nBalanceAnonimizableNonDenom: %f, nBalanceDenominatedConf: %f, nBalanceDenominatedUnconf: %f, nBalanceDenominated: %f\n",
(float)nValueMin / COIN,
(float)nBalanceNeedsAnonymized / COIN,
(float)nBalanceAnonimizableNonDenom / COIN,
(float)nBalanceDenominatedConf / COIN,
(float)nBalanceDenominatedUnconf / COIN,
(float)nBalanceDenominated / COIN);
LogPrint("privatesend", "CPrivateSendClientSession::DoAutomaticDenominating -- current stats:\n"
" nValueMin: %s\n"
" nBalanceNeedsAnonymized: %s\n"
" nBalanceAnonimizableNonDenom: %s\n"
" nBalanceDenominatedConf: %s\n"
" nBalanceDenominatedUnconf: %s\n"
" nBalanceDenominated: %s\n",
FormatMoney(nValueMin),
FormatMoney(nBalanceNeedsAnonymized),
FormatMoney(nBalanceAnonimizableNonDenom),
FormatMoney(nBalanceDenominatedConf),
FormatMoney(nBalanceDenominatedUnconf),
FormatMoney(nBalanceDenominated)
);

if (fDryRun) return true;

Expand Down
2 changes: 1 addition & 1 deletion src/qt/overviewpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ void OverviewPage::privateSendStatus()
QString s = tr("Last PrivateSend message:\n") + strStatus;

if(s != ui->labelPrivateSendLastMessage->text())
LogPrintf("OverviewPage::privateSendStatus -- Last PrivateSend message: %s\n", strStatus.toStdString());
LogPrint("privatesend", "OverviewPage::privateSendStatus -- Last PrivateSend message: %s\n", strStatus.toStdString());

ui->labelPrivateSendLastMessage->setText(s);

Expand Down
1 change: 1 addition & 0 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,7 @@ void RenameThread(const char* name)
// Prevent warnings for unused parameters...
(void)name;
#endif
LogPrintf("%s: thread new name %s\n", __func__, name);
}

std::string GetThreadName()
Expand Down
8 changes: 4 additions & 4 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2491,14 +2491,14 @@ void static UpdateTip(CBlockIndex *pindexNew, const CChainParams& chainParams) {
}
}
}
LogPrintf("%s: new best=%s height=%d version=0x%08x log2_work=%.8f tx=%lu date='%s' progress=%f cache=%.1fMiB(%utxo)", __func__,
std::string strMessage = strprintf("%s: new best=%s height=%d version=0x%08x log2_work=%.8f tx=%lu date='%s' progress=%f cache=%.1fMiB(%utxo)", __func__,
chainActive.Tip()->GetBlockHash().ToString(), chainActive.Height(), chainActive.Tip()->nVersion,
log(chainActive.Tip()->nChainWork.getdouble())/log(2.0), (unsigned long)chainActive.Tip()->nChainTx,
DateTimeStrFormat("%Y-%m-%d %H:%M:%S", chainActive.Tip()->GetBlockTime()),
GuessVerificationProgress(chainParams.TxData(), chainActive.Tip()), pcoinsTip->DynamicMemoryUsage() * (1.0 / (1<<20)), pcoinsTip->GetCacheSize());
if (!warningMessages.empty())
LogPrintf(" warning='%s'", boost::algorithm::join(warningMessages, ", "));
LogPrintf("\n");
strMessage += strprintf(" warning='%s'", boost::algorithm::join(warningMessages, ", "));
LogPrintf("%s\n", strMessage);
}

/** Disconnect chainActive's tip. You probably want to call mempool.removeForReorg and manually re-limit mempool size after this, with cs_main held. */
Expand Down Expand Up @@ -2603,7 +2603,7 @@ bool static ConnectTip(CValidationState& state, const CChainParams& chainparams,
if (!rv) {
if (state.IsInvalid())
InvalidBlockFound(pindexNew, state);
return error("ConnectTip(): ConnectBlock %s failed", pindexNew->GetBlockHash().ToString());
return error("ConnectTip(): ConnectBlock %s failed with %s", pindexNew->GetBlockHash().ToString(), FormatStateMessage(state));
}
nTime3 = GetTimeMicros(); nTimeConnectTotal += nTime3 - nTime2;
LogPrint("bench", " - Connect total: %.2fms [%.2fs]\n", (nTime3 - nTime2) * 0.001, nTimeConnectTotal * 0.000001);
Expand Down