diff options
author | stratospher <44024636+stratospher@users.noreply.github.com> | 2023-10-11 10:50:31 +0530 |
---|---|---|
committer | stratospher <44024636+stratospher@users.noreply.github.com> | 2024-01-08 21:54:56 +0530 |
commit | be25ac3092b7755e26e1ec6c33a27cd0e3dd9eac (patch) | |
tree | 86ca894b2b93f7c3d8e244da8cb8171a8a01d3dc /src/net.cpp | |
parent | 802e6e128bba5ffa6d4ec53ff45acccb7cb28f21 (diff) | |
download | bitcoin-be25ac3092b7755e26e1ec6c33a27cd0e3dd9eac.tar.xz |
[init] Remove -addrmantest command line arg
-addrmantest is only used in `p2p_node_network_limited.py` test to
test if the node self-advertises a hard-coded local address
(which wouldn't be advertised in the tests because it's unroutable
without the test-only code path) to check pruning-related services
are correct in that addr.
Remove -addrmantest because the self advertisement happens because
of hard coded test path logic, and expected services are nominal
due to how easily the test-only code could diverge from mainnet
logic. It's also being used only in 1 test.
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/net.cpp b/src/net.cpp index 41f5323d91..4e5ac387db 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -238,10 +238,6 @@ static int GetnScore(const CService& addr) std::optional<CService> GetLocalAddrForPeer(CNode& node) { CService addrLocal{GetLocalAddress(node)}; - if (gArgs.GetBoolArg("-addrmantest", false)) { - // use IPv4 loopback during addrmantest - addrLocal = CService(LookupNumeric("127.0.0.1", GetListenPort())); - } // If discovery is enabled, sometimes give our peer the address it // tells us that it sees us as in case it has a better idea of our // address than we do. @@ -261,8 +257,7 @@ std::optional<CService> GetLocalAddrForPeer(CNode& node) addrLocal.SetIP(node.GetAddrLocal()); } } - if (addrLocal.IsRoutable() || gArgs.GetBoolArg("-addrmantest", false)) - { + if (addrLocal.IsRoutable()) { LogPrint(BCLog::NET, "Advertising address %s to peer=%d\n", addrLocal.ToStringAddrPort(), node.GetId()); return addrLocal; } |