Skip to content

Commit

Permalink
[Trivial] Set log2_work decimals to 16 in the logs
Browse files Browse the repository at this point in the history
Github-Pull: #1252
Rebased-From: d83e67c
  • Loading branch information
random-zebra authored and Fuzzbawls committed Jan 11, 2020
1 parent a80e2e9 commit b7c63b8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main.cpp
Expand Up @@ -2419,11 +2419,11 @@ void static InvalidChainFound(CBlockIndex* pindexNew)
if (!pindexBestInvalid || pindexNew->nChainWork > pindexBestInvalid->nChainWork)
pindexBestInvalid = pindexNew;

LogPrintf("InvalidChainFound: invalid block=%s height=%d log2_work=%.8g date=%s\n",
LogPrintf("InvalidChainFound: invalid block=%s height=%d log2_work=%.16f date=%s\n",
pindexNew->GetBlockHash().ToString(), pindexNew->nHeight,
log(pindexNew->nChainWork.getdouble()) / log(2.0), DateTimeStrFormat("%Y-%m-%d %H:%M:%S",
pindexNew->GetBlockTime()));
LogPrintf("InvalidChainFound: current best=%s height=%d log2_work=%.8g date=%s\n",
LogPrintf("InvalidChainFound: current best=%s height=%d log2_work=%.16f date=%s\n",
chainActive.Tip()->GetBlockHash().ToString(), chainActive.Height(), log(chainActive.Tip()->nChainWork.getdouble()) / log(2.0),
DateTimeStrFormat("%Y-%m-%d %H:%M:%S", chainActive.Tip()->GetBlockTime()));
CheckForkWarningConditions();
Expand Down Expand Up @@ -3586,7 +3586,7 @@ void static UpdateTip(CBlockIndex* pindexNew)
g_best_block_cv.notify_all();
}

LogPrintf("UpdateTip: new best=%s height=%d version=%d log2_work=%.8g tx=%lu date=%s progress=%f cache=%u\n",
LogPrintf("UpdateTip: new best=%s height=%d version=%d log2_work=%.16f tx=%lu date=%s progress=%f cache=%u\n",
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()),
Checkpoints::GuessVerificationProgress(chainActive.Tip()), (unsigned int)pcoinsTip->GetCacheSize());
Expand Down

0 comments on commit b7c63b8

Please sign in to comment.