aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@protonmail.com>2020-11-19 16:39:27 +0100
committerWladimir J. van der Laan <laanwj@protonmail.com>2020-11-19 16:39:31 +0100
commit848d66519c392093dbc1bbd5689f84be5ecd9bc8 (patch)
tree4f8d24e76631e1a3161fddd7751028bd15ed1a8d /src
parent884bde510e2db59ee44604e2cccabb0bf1ef6ada (diff)
parent0000a0c7e9e4e7c1afafe6ef75b7624f4c573190 (diff)
Merge #20054: Remove confusing and useless "unexpected version" warning
0000a0c7e9e4e7c1afafe6ef75b7624f4c573190 Remove confusing and almost useless "unexpected version" warning (MarcoFalke) Pull request description: It is useless because it isn't displayed for most users: * It isn't displayed in normal operation (because the validation debug category is disabled by default) * It isn't displayed for users that sync up their nodes intermittently, e.g. once a day or once a week (because it is disabled for IBD) * It is only displayed in the debug log (as opposed to the versionbits warning, which is displayed more prominently) It is confusing because it doesn't have a use case: Despite the above, if a user *did* see the warning, it would most likely be a false positive (like it has been in the past). Even if it wasn't, there is nothing they can do about it. The only thing they could do is to check for updates and hope that a fixed version is available. But why would the user be so scrupulously precise in enabling the warning and reading the log, but then fail to regularly check update channels for updated software? ACKs for top commit: practicalswift: ACK 0000a0c7e9e4e7c1afafe6ef75b7624f4c573190 decryp2kanon: ACK 0000a0c LarryRuane: ACK 0000a0c7e9e4e7c1afafe6ef75b7624f4c573190 Tree-SHA512: 16e069c84be6ab6034baeefdc515d0e5cdf560b2005d2faec5f989d45494bd16cfcb4ffca6a17211d9556ae44f9737a60a476c08b5c2bb5e1bd29724ecd6d5c1
Diffstat (limited to 'src')
-rw-r--r--src/validation.cpp16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 8c87c53ac7..71402ef263 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -2398,9 +2398,7 @@ static void UpdateTip(CTxMemPool& mempool, const CBlockIndex* pindexNew, const C
}
bilingual_str warning_messages;
- int num_unexpected_version = 0;
- if (!::ChainstateActive().IsInitialBlockDownload())
- {
+ if (!::ChainstateActive().IsInitialBlockDownload()) {
const CBlockIndex* pindex = pindexNew;
for (int bit = 0; bit < VERSIONBITS_NUM_BITS; bit++) {
WarningBitsConditionChecker checker(bit);
@@ -2414,14 +2412,6 @@ static void UpdateTip(CTxMemPool& mempool, const CBlockIndex* pindexNew, const C
}
}
}
- // Check the version of the last 100 blocks to see if we need to upgrade:
- for (int i = 0; i < 100 && pindex != nullptr; i++)
- {
- int32_t nExpectedVersion = ComputeBlockVersion(pindex->pprev, chainParams.GetConsensus());
- if (pindex->nVersion > VERSIONBITS_LAST_OLD_BLOCK_VERSION && (pindex->nVersion & ~nExpectedVersion) != 0)
- ++num_unexpected_version;
- pindex = pindex->pprev;
- }
}
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__,
pindexNew->GetBlockHash().ToString(), pindexNew->nHeight, pindexNew->nVersion,
@@ -2429,10 +2419,6 @@ static void UpdateTip(CTxMemPool& mempool, const CBlockIndex* pindexNew, const C
FormatISO8601DateTime(pindexNew->GetBlockTime()),
GuessVerificationProgress(chainParams.TxData(), pindexNew), ::ChainstateActive().CoinsTip().DynamicMemoryUsage() * (1.0 / (1<<20)), ::ChainstateActive().CoinsTip().GetCacheSize(),
!warning_messages.empty() ? strprintf(" warning='%s'", warning_messages.original) : "");
-
- if (num_unexpected_version > 0) {
- LogPrint(BCLog::VALIDATION, "%d of last 100 blocks have unexpected version\n", num_unexpected_version);
- }
}
/** Disconnect m_chain's tip.