Skip to content

Commit

Permalink
rpc/gui: Remove 'Unknown block versions being mined' warning
Browse files Browse the repository at this point in the history
Due to miners inserting garbage into the version numbers, the current
version signalling has become completely useless. This removes the
"unknown block versions" warning which has the tendency to scare
users unnecessarily (and might get them to "update" to something
bad).

It preserves the warning in the logs. Whether this is desirable can
be a point of discussion.
  • Loading branch information
laanwj committed Feb 25, 2019
1 parent 1a8a5ed commit 211c5f7
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 135 deletions.
6 changes: 0 additions & 6 deletions src/validation.cpp
Expand Up @@ -2259,12 +2259,6 @@ void static UpdateTip(const CBlockIndex *pindexNew, const CChainParams& chainPar
}
if (nUpgraded > 0)
AppendWarning(warningMessages, strprintf(_("%d of last 100 blocks have unexpected version"), nUpgraded));
if (nUpgraded > 100/2)
{
std::string strWarning = _("Warning: Unknown block versions being mined! It's possible unknown rules are in effect");
// notify GetWarnings(), called by Qt and the JSON-RPC code to warn the user:
DoWarning(strWarning);
}
}
LogPrintf("%s: new best=%s height=%d version=0x%08x log2_work=%.8g tx=%lu date='%s' progress=%f cache=%.1fMiB(%utxo)", __func__, /* Continued */
pindexNew->GetBlockHash().ToString(), pindexNew->nHeight, pindexNew->nVersion,
Expand Down
18 changes: 0 additions & 18 deletions test/functional/feature_notifications.py
Expand Up @@ -66,23 +66,5 @@ def run_test(self):
txids_rpc = list(map(lambda t: t['txid'], self.nodes[1].listtransactions("*", block_count)))
assert_equal(sorted(txids_rpc), sorted(os.listdir(self.walletnotify_dir)))

# Mine another 41 up-version blocks. -alertnotify should trigger on the 51st.
self.log.info("test -alertnotify")
self.nodes[1].generatetoaddress(41, ADDRESS_BCRT1_UNSPENDABLE)
self.sync_all()

# Give bitcoind 10 seconds to write the alert notification
wait_until(lambda: len(os.listdir(self.alertnotify_dir)), timeout=10)

for notify_file in os.listdir(self.alertnotify_dir):
os.remove(os.path.join(self.alertnotify_dir, notify_file))

# Mine more up-version blocks, should not get more alerts:
self.nodes[1].generatetoaddress(2, ADDRESS_BCRT1_UNSPENDABLE)
self.sync_all()

self.log.info("-alertnotify should not continue notifying for more unknown version blocks")
assert_equal(len(os.listdir(self.alertnotify_dir)), 0)

if __name__ == '__main__':
NotificationsTest().main()
110 changes: 0 additions & 110 deletions test/functional/feature_versionbits_warning.py

This file was deleted.

1 change: 0 additions & 1 deletion test/functional/test_runner.py
Expand Up @@ -147,7 +147,6 @@
'feature_rbf.py',
'mempool_packages.py',
'rpc_createmultisig.py',
'feature_versionbits_warning.py',
'rpc_preciousblock.py',
'wallet_importprunedfunds.py',
'p2p_leak_tx.py',
Expand Down

0 comments on commit 211c5f7

Please sign in to comment.