Skip to content

Commit 0000a0c

Browse files
author
MarcoFalke
committed
Remove confusing and almost useless "unexpected version" warning
1 parent 9fc2f01 commit 0000a0c

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

src/validation.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2449,9 +2449,7 @@ static void UpdateTip(CTxMemPool& mempool, const CBlockIndex* pindexNew, const C
24492449
}
24502450

24512451
bilingual_str warning_messages;
2452-
int num_unexpected_version = 0;
2453-
if (!::ChainstateActive().IsInitialBlockDownload())
2454-
{
2452+
if (!::ChainstateActive().IsInitialBlockDownload()) {
24552453
const CBlockIndex* pindex = pindexNew;
24562454
for (int bit = 0; bit < VERSIONBITS_NUM_BITS; bit++) {
24572455
WarningBitsConditionChecker checker(bit);
@@ -2465,25 +2463,13 @@ static void UpdateTip(CTxMemPool& mempool, const CBlockIndex* pindexNew, const C
24652463
}
24662464
}
24672465
}
2468-
// Check the version of the last 100 blocks to see if we need to upgrade:
2469-
for (int i = 0; i < 100 && pindex != nullptr; i++)
2470-
{
2471-
int32_t nExpectedVersion = ComputeBlockVersion(pindex->pprev, chainParams.GetConsensus());
2472-
if (pindex->nVersion > VERSIONBITS_LAST_OLD_BLOCK_VERSION && (pindex->nVersion & ~nExpectedVersion) != 0)
2473-
++num_unexpected_version;
2474-
pindex = pindex->pprev;
2475-
}
24762466
}
24772467
LogPrintf("%s: new best=%s height=%d version=0x%08x log2_work=%f tx=%lu date='%s' progress=%f cache=%.1fMiB(%utxo)%s\n", __func__,
24782468
pindexNew->GetBlockHash().ToString(), pindexNew->nHeight, pindexNew->nVersion,
24792469
log(pindexNew->nChainWork.getdouble())/log(2.0), (unsigned long)pindexNew->nChainTx,
24802470
FormatISO8601DateTime(pindexNew->GetBlockTime()),
24812471
GuessVerificationProgress(chainParams.TxData(), pindexNew), ::ChainstateActive().CoinsTip().DynamicMemoryUsage() * (1.0 / (1<<20)), ::ChainstateActive().CoinsTip().GetCacheSize(),
24822472
!warning_messages.empty() ? strprintf(" warning='%s'", warning_messages.original) : "");
2483-
2484-
if (num_unexpected_version > 0) {
2485-
LogPrint(BCLog::VALIDATION, "%d of last 100 blocks have unexpected version\n", num_unexpected_version);
2486-
}
24872473
}
24882474

24892475
/** Disconnect m_chain's tip.

0 commit comments

Comments
 (0)