Skip to content

Commit

Permalink
[Trivial] Fix styling/logging nits
Browse files Browse the repository at this point in the history
  • Loading branch information
random-zebra committed Apr 18, 2021
1 parent 637812d commit 051c1f6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions src/activemasternode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ void CActiveDeterministicMasternodeManager::Init()
// listen option is probably overwritten by smth else, no good
state = MASTERNODE_ERROR;
strError = "Masternode must accept connections from outside. Make sure listen configuration option is not overwritten by some another parameter.";
LogPrintf("%s -- ERROR: %s\n", __func__, strError);
LogPrintf("%s ERROR: %s\n", __func__, strError);
return;
}

if (!GetLocalAddress(info.service)) {
state = MASTERNODE_ERROR;
strError = "Can't detect valid external address. Please consider using the externalip configuration option if problem persists. Make sure to use IPv4 address only.";
LogPrintf("%s -- ERROR: %s\n", __func__, strError);
LogPrintf("%s ERROR: %s\n", __func__, strError);
return;
}

Expand All @@ -107,27 +107,27 @@ void CActiveDeterministicMasternodeManager::Init()
return;
}

LogPrintf("%s -- proTxHash=%s, proTx=%s\n", __func__, dmn->proTxHash.ToString(), dmn->ToString());
LogPrintf("%s: proTxHash=%s, proTx=%s\n", __func__, dmn->proTxHash.ToString(), dmn->ToString());

if (info.service != dmn->pdmnState->addr) {
state = MASTERNODE_ERROR;
strError = strprintf("Local address %s does not match the address from ProTx (%s)",
info.service.ToStringIPPort(), dmn->pdmnState->addr.ToStringIPPort());
LogPrintf("%s -- ERROR: %s\n", __func__, strError);
LogPrintf("%s ERROR: %s\n", __func__, strError);
return;
}

if (!Params().IsRegTestNet()) {
// Check socket connectivity
const std::string& strService = info.service.ToString();
LogPrintf("%s -- Checking inbound connection to '%s'\n", __func__, strService);
LogPrintf("%s: Checking inbound connection to '%s'\n", __func__, strService);
SOCKET hSocket;
bool fConnected = ConnectSocket(info.service, hSocket, nConnectTimeout) && IsSelectableSocket(hSocket);
CloseSocket(hSocket);

if (!fConnected) {
state = MASTERNODE_ERROR;
LogPrintf("%s -- ERROR: Could not connect to %s\n", __func__, strService);
LogPrintf("%s ERROR: Could not connect to %s\n", __func__, strService);
return;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/evo/deterministicmns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ CDeterministicMNCPtr CDeterministicMNList::GetMNByInternalId(uint64_t internalId
return GetMN(*proTxHash);
}

static int CompareByLastPaid_GetHeight(const CDeterministicMN& dmn)
static int CompareByLastPaidGetHeight(const CDeterministicMN& dmn)
{
int height = dmn.pdmnState->nLastPaidHeight;
if (dmn.pdmnState->nPoSeRevivedHeight != -1 && dmn.pdmnState->nPoSeRevivedHeight > height) {
Expand All @@ -201,8 +201,8 @@ static int CompareByLastPaid_GetHeight(const CDeterministicMN& dmn)

static bool CompareByLastPaid(const CDeterministicMN& _a, const CDeterministicMN& _b)
{
int ah = CompareByLastPaid_GetHeight(_a);
int bh = CompareByLastPaid_GetHeight(_b);
int ah = CompareByLastPaidGetHeight(_a);
int bh = CompareByLastPaidGetHeight(_b);
if (ah == bh) {
return _a.proTxHash < _b.proTxHash;
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1907,9 +1907,9 @@ bool AppInitMain()
if (fDeterministic) {
// Check enforcement
if (!deterministicMNManager->IsDIP3Enforced()) {
const std::string strError = "Cannot start deterministic masternode before enforcement. Remove -mnoperatorprivatekey to start as legacy masternode";
const std::string strError = strprintf(_("Cannot start deterministic masternode before enforcement. Remove %s to start as legacy masternode"), "-mnoperatorprivatekey");
LogPrintf("-- ERROR: %s\n", strError);
return UIError(_(strError.c_str()));
return UIError(strError);
}
// Create and register activeMasternodeManager
activeMasternodeManager = new CActiveDeterministicMasternodeManager();
Expand All @@ -1921,9 +1921,9 @@ bool AppInitMain()
} else {
// Check enforcement
if (deterministicMNManager->LegacyMNObsolete()) {
const std::string strError = "Legacy masternode system disabled. Use -mnoperatorprivatekey to start as deterministic masternode";
const std::string strError = strprintf(_("Legacy masternode system disabled. Use %s to start as deterministic masternode"), "-mnoperatorprivatekey");
LogPrintf("-- ERROR: %s\n", strError);
return UIError(_(strError.c_str()));
return UIError(strError);
}
auto res = initMasternode(gArgs.GetArg("-masternodeprivkey", ""), gArgs.GetArg("-masternodeaddr", ""), true);
if (!res) { return UIError(res.getError()); }
Expand Down
6 changes: 3 additions & 3 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1937,12 +1937,12 @@ void static UpdateTip(CBlockIndex* pindexNew)
}

const CBlockIndex* pChainTip = chainActive.Tip();
LogPrintf("%s: new best=%s height=%d version=%d log2_work=%.16f tx=%lu date=%s progress=%f cache=%.1fMiB(%utxo)\n",
LogPrintf("%s: new best=%s height=%d version=%d log2_work=%.16f tx=%lu date=%s progress=%f cache=%.1fMiB(%utxo) evodb_cache=%.1fMiB\n",
__func__,
pChainTip->GetBlockHash().GetHex(), pChainTip->nHeight, pChainTip->nVersion, log(pChainTip->nChainWork.getdouble()) / log(2.0), (unsigned long)pChainTip->nChainTx,
DateTimeStrFormat("%Y-%m-%d %H:%M:%S", pChainTip->GetBlockTime()),
Checkpoints::GuessVerificationProgress(pChainTip), pcoinsTip->DynamicMemoryUsage() * (1.0 / (1<<20)), pcoinsTip->GetCacheSize());
LogPrintf("%s: evodb_cache=%.1fMiB\n", __func__, evoDb->GetMemoryUsage() * (1.0 / (1<<20)));
Checkpoints::GuessVerificationProgress(pChainTip), pcoinsTip->DynamicMemoryUsage() * (1.0 / (1<<20)), pcoinsTip->GetCacheSize(),
evoDb->GetMemoryUsage() * (1.0 / (1<<20)));

// Check the version of the last 100 blocks to see if we need to upgrade:
static bool fWarned = false;
Expand Down

0 comments on commit 051c1f6

Please sign in to comment.