diff --git a/src/clientversion.h b/src/clientversion.h index 0d3fd033a37f9..b28abc136cf8b 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -45,6 +45,8 @@ std::string CopyrightHolders(const std::string& strPrefix); /** Returns licensing information (for -version) */ std::string LicenseInfo(); +static constexpr bool DEFAULT_UA_HIDE_KNOTS = false; + static constexpr int64_t SECONDS_PER_YEAR = 31558060; static constexpr int POSIX_EPOCH_YEAR = 1970; static constexpr int64_t DEFAULT_SOFTWARE_EXPIRY_OFFSET = 26784000; // Around Nov 7 diff --git a/src/init.cpp b/src/init.cpp index 64ed601bc1e2c..70be5fbaf666e 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -669,6 +669,7 @@ void SetupServerArgs(ArgsManager& argsman) argsman.AddArg("-printpriority", strprintf("Log transaction priority and fee rate in " + CURRENCY_UNIT + "/kvB when mining blocks (default: %u)", DEFAULT_PRINT_MODIFIED_FEE), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); argsman.AddArg("-uaappend=", "Append literal to the user agent string (should only be used for software embedding)", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); argsman.AddArg("-uacomment=", "Append comment to the user agent string", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST); + argsman.AddArg("-uahideknots", strprintf("Hide Knots from the user agent string (default: %u)", DEFAULT_UA_HIDE_KNOTS), ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST); SetupChainParamsBaseOptions(argsman); @@ -1508,7 +1509,8 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) return InitError(strprintf(_("User Agent comment (%s) contains unsafe characters."), cmt)); uacomments.push_back(cmt); } - strSubVersion = FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, uacomments); + bool base_name_only = args.GetBoolArg("-uahideknots", DEFAULT_UA_HIDE_KNOTS); + strSubVersion = FormatSubVersion(CLIENT_NAME, CLIENT_VERSION, uacomments, base_name_only); for (auto append : gArgs.GetArgs("-uaappend")) { if (append.back() != '/') append += '/'; strSubVersion += append; @@ -1702,10 +1704,6 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) LogPrintf("* Flushing caches if available system memory drops below %s MiB\n", g_low_memory_threshold / 1024 / 1024); } - if (mempool_opts.rbf_policy == RBFPolicy::Always) { - nLocalServices = ServiceFlags(nLocalServices | NODE_REPLACE_BY_FEE); - } - for (bool fLoaded = false; !fLoaded && !ShutdownRequested(node);) { bilingual_str mempool_error; node.mempool = std::make_unique(mempool_opts, mempool_error); diff --git a/src/protocol.cpp b/src/protocol.cpp index 8d98c967893e0..0439d398c742e 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -99,7 +99,6 @@ static std::string serviceFlagToStr(size_t bit) case NODE_COMPACT_FILTERS: return "COMPACT_FILTERS"; case NODE_NETWORK_LIMITED: return "NETWORK_LIMITED"; case NODE_P2P_V2: return "P2P_V2"; - case NODE_REPLACE_BY_FEE: return "REPLACE_BY_FEE?"; // Not using default, so we get warned when a case is missing } diff --git a/src/protocol.h b/src/protocol.h index 0fe0810cfcfb6..4ab2966dfc22d 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -336,8 +336,6 @@ enum ServiceFlags : uint64_t { // collisions and other cases where nodes may be advertising a service they // do not actually support. Other service bits should be allocated via the // BIP process. - - NODE_REPLACE_BY_FEE = (1 << 26), }; /** diff --git a/test/functional/feature_rbf.py b/test/functional/feature_rbf.py index 1bc77d71e5b5a..85b3c4bae8a11 100755 --- a/test/functional/feature_rbf.py +++ b/test/functional/feature_rbf.py @@ -66,14 +66,6 @@ def test_rpc_rbf_policy(): test_rpc_rbf_policy() self.log.info("Running test service flag") - def test_service_flag(): - NODE_REPLACE_BY_FEE = (1 << 26) - for i in range(3): - assert not (int(self.nodes[i].getnetworkinfo()['localservices'], 0x10) & NODE_REPLACE_BY_FEE) - assert 'REPLACE_BY_FEE?' not in self.nodes[i].getnetworkinfo()['localservicesnames'] - assert int(self.nodes[3].getnetworkinfo()['localservices'], 0x10) & NODE_REPLACE_BY_FEE - assert 'REPLACE_BY_FEE?' in self.nodes[3].getnetworkinfo()['localservicesnames'] - test_service_flag() self.log.info("Running test simple doublespend...") self.test_simple_doublespend() diff --git a/test/functional/p2p_node_network_limited.py b/test/functional/p2p_node_network_limited.py index c1b500869dd22..5acf981cc3a61 100755 --- a/test/functional/p2p_node_network_limited.py +++ b/test/functional/p2p_node_network_limited.py @@ -15,7 +15,6 @@ NODE_NETWORK_LIMITED, NODE_P2P_V2, NODE_WITNESS, - NODE_REPLACE_BY_FEE, msg_getdata, ) from test_framework.p2p import P2PInterface @@ -120,7 +119,7 @@ def test_avoid_requesting_historical_blocks(self): def run_test(self): node = self.nodes[0].add_p2p_connection(P2PIgnoreInv()) - expected_services = NODE_BLOOM | NODE_WITNESS | NODE_NETWORK_LIMITED | NODE_REPLACE_BY_FEE + expected_services = NODE_BLOOM | NODE_WITNESS | NODE_NETWORK_LIMITED if self.options.v2transport: expected_services |= NODE_P2P_V2 diff --git a/test/functional/test_framework/messages.py b/test/functional/test_framework/messages.py index a4c1b3072167a..1f566a1348a24 100755 --- a/test/functional/test_framework/messages.py +++ b/test/functional/test_framework/messages.py @@ -53,7 +53,6 @@ NODE_COMPACT_FILTERS = (1 << 6) NODE_NETWORK_LIMITED = (1 << 10) NODE_P2P_V2 = (1 << 11) -NODE_REPLACE_BY_FEE = (1 << 26) MSG_TX = 1 MSG_BLOCK = 2