diff options
author | John Newbery <john@johnnewbery.com> | 2020-12-22 17:48:31 +0000 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2020-12-22 17:48:31 +0000 |
commit | 176325a5a47befe32d480b3dc206dd0e64e04b21 (patch) | |
tree | 6e51f5ea77d8cd98761b17545351693b2610250f /src | |
parent | 9286b1cbce78d7e427135ba8b5e8f56c9a611a81 (diff) |
[net processing] Remove dropmessagestest
-dropmessagestest is a command line option that causes 1 in n received
messages to be dropped. The Bitcoin P2P protocol is stateful and in
general cannot handle messages being dropped. Dropped
version/verack/ping/pong messages will cause the connection to time out
and be torn down. Other dropped messages may also cause the peer to
believe that the peer has stalled and tear down the connection.
It seems difficult to uncover any actual issues with -dropmessagestest,
and any coverage that could be generated would probably be easier to
trigger with fuzz testing.
Diffstat (limited to 'src')
-rw-r--r-- | src/init.cpp | 1 | ||||
-rw-r--r-- | src/net_processing.cpp | 5 |
2 files changed, 0 insertions, 6 deletions
diff --git a/src/init.cpp b/src/init.cpp index 1220f39b14..97a588c8df 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -508,7 +508,6 @@ void SetupServerArgs(NodeContext& node) argsman.AddArg("-checkmempool=<n>", strprintf("Run checks every <n> transactions (default: %u, regtest: %u)", defaultChainParams->DefaultConsistencyChecks(), regtestChainParams->DefaultConsistencyChecks()), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); argsman.AddArg("-checkpoints", strprintf("Enable rejection of any forks from the known historical chain until block %s (default: %u)", defaultChainParams->Checkpoints().GetHeight(), DEFAULT_CHECKPOINTS_ENABLED), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); argsman.AddArg("-deprecatedrpc=<method>", "Allows deprecated RPC method(s) to be used", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); - argsman.AddArg("-dropmessagestest=<n>", "Randomly drop 1 of every <n> network messages", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); argsman.AddArg("-stopafterblockimport", strprintf("Stop running after importing blocks from disk (default: %u)", DEFAULT_STOPAFTERBLOCKIMPORT), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); argsman.AddArg("-stopatheight", strprintf("Stop running after reaching the given height in the main chain (default: %u)", DEFAULT_STOPATHEIGHT), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); argsman.AddArg("-limitancestorcount=<n>", strprintf("Do not accept transactions if number of in-mempool ancestors is <n> or more (default: %u)", DEFAULT_ANCESTOR_LIMIT), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 4b9688d517..0dfb8e1344 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -2272,11 +2272,6 @@ void PeerManager::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDat const std::atomic<bool>& interruptMsgProc) { LogPrint(BCLog::NET, "received: %s (%u bytes) peer=%d\n", SanitizeString(msg_type), vRecv.size(), pfrom.GetId()); - if (gArgs.IsArgSet("-dropmessagestest") && GetRand(gArgs.GetArg("-dropmessagestest", 0)) == 0) - { - LogPrintf("dropmessagestest DROPPING RECV MESSAGE\n"); - return; - } PeerRef peer = GetPeerRef(pfrom.GetId()); if (peer == nullptr) return; |