Skip to content

Commit 7bdf802

Browse files
3260f2c partial bitcoin#27106: remove orphaned CSubNet::SanityCheck() (Kittywhiskers Van Gogh) 75cc94e merge bitcoin#27270: Avoid CNode::m_relays_txs usage (Kittywhiskers Van Gogh) f961903 merge bitcoin#27036: Remove last uses of snprintf and simplify (Kittywhiskers Van Gogh) d80bbe9 merge bitcoin#26199: Don't self-advertise during version processing (Kittywhiskers Van Gogh) 4b17baf merge bitcoin#26248: Set relay in version msg to peers with relay permission in -blocksonly mode (Kittywhiskers Van Gogh) 18738f5 merge bitcoin#25421: convert standalone IsSelectableSocket() and SetSocketNonBlocking() to Sock methods (Kittywhiskers Van Gogh) 8782575 merge bitcoin#25176: Fix frequent -netinfo JSON errors from missing getpeerinfo#relaytxes (Kittywhiskers Van Gogh) 1d96a47 merge bitcoin#25119: move StartExtraBlockRelayPeers() from header to implementation (Kittywhiskers Van Gogh) 37e0c58 merge bitcoin#24468: improve -onlynet help and related tor/i2p documentation (Kittywhiskers Van Gogh) 52c3b03 merge bitcoin#23542: open p2p connections to nodes that listen on non-default ports (Kittywhiskers Van Gogh) 8e2a12a merge bitcoin#22732: use m_client_interface rather than uiInterface (Kittywhiskers Van Gogh) 06a8e9c merge bitcoin#21845: Don't require locking cs_main before calling RelayTransactions() (Kittywhiskers Van Gogh) Pull request description: ## Additional Information * Due to changes introduced in [bitcoin#21845](bitcoin#21845), a `LOCK(cs_main)` had to be added to `PeerManagerImpl::ReattemptInitialBroadcast()` ([source](06a8e9c#diff-6875de769e90cec84d2e8a9c1b962cdbcda44d870d42e4215827e599e11e90e3R1634)). This addition is in line with upstream ([source](https://github.com/bitcoin/bitcoin/blob/39e19713cd6594f93db835e8ef7eef5824a9ba02/src/net_processing.cpp#L1021)). * While nodes have been allowed to connect to non-default ports since [dash#2168](#2168), [bitcoin#23542](bitcoin#23542) also adds a list of ports considered "bad" that while not outright prohibited, are heavily discouraged from use as they are considered _de facto_ prohibited. In combination with port restrictions for masternodes (connections only permitted if matching listening port), port validation logic was better served by implementing it in a lambda block that's immediately executed (see `is_prohibited_port` for more information, [source](https://github.com/dashpay/dash/blob/01975fba32b8fcd8bccb0ce293b217c07b522c53/src/net.cpp#L3551-L3567)). * In [bitcoin#25176](bitcoin#25176), `is_block_relay` is renamed to `is_tx_relay` as the block relay-only = not transaction-relay assumption no longer holds true (see [dash#6365](#6365) for more information). One use of `is_block_relay` which relied on this now-obsolete assumption is incrementing `m_block_relay_peers_count`. It has been replaced with checking for a `block-relay-only` `conn_type`, matching upstream ([source](https://github.com/bitcoin/bitcoin/blob/a17c5e96b602fed65166037b78d98605e915206b/src/bitcoin-cli.cpp#L486)). ## Breaking Changes None expected. ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: utACK 3260f2c PastaPastaPasta: utACK 3260f2c Tree-SHA512: 2bb50deb77ffaf7f7c4b396a8efe03f8bbfa605b49b75eace5fbc9d9813d4de8b72b086c50fbb0c23b97237c1f4c1b30b68f4b456bb74875308a4fcaa82deb08
2 parents 73614eb + 3260f2c commit 7bdf802

26 files changed

+457
-182
lines changed

doc/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ The Dash Core repo's [root README](/README.md) contains relevant information on
7676
- [I2P Support](i2p.md)
7777
- [Init Scripts (systemd/upstart/openrc)](init.md)
7878
- [Managing Wallets](managing-wallets.md)
79+
- [P2P bad ports definition and list](p2p-bad-ports.md)
7980
- [PSBT support](psbt.md)
8081
- [Reduce Memory](reduce-memory.md)
8182
- [Reduce Traffic](reduce-traffic.md)

doc/p2p-bad-ports.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
When Dash Core automatically opens outgoing P2P connections, it chooses
2+
a peer (address and port) from its list of potential peers. This list is
3+
populated with unchecked data gossiped over the P2P network by other peers.
4+
5+
A malicious actor may gossip an address:port where no Dash node is listening,
6+
or one where a service is listening that is not related to the Dash network.
7+
As a result, this service may occasionally get connection attempts from Dash
8+
nodes.
9+
10+
"Bad" ports are ones used by services which are usually not open to the public
11+
and usually require authentication. A connection attempt (by Dash Core,
12+
trying to connect because it thinks there is a Dash node on that
13+
address:port) to such service may be considered a malicious action by an
14+
ultra-paranoid administrator. An example for such a port is 22 (ssh). On the
15+
other hand, connection attempts to public services that usually do not require
16+
authentication are unlikely to be considered a malicious action,
17+
e.g. port 80 (http).
18+
19+
Below is a list of "bad" ports which Dash Core avoids when choosing a peer to
20+
connect to. If a node is listening on such a port, it will likely receive fewer
21+
incoming connections.
22+
23+
1: tcpmux
24+
7: echo
25+
9: discard
26+
11: systat
27+
13: daytime
28+
15: netstat
29+
17: qotd
30+
19: chargen
31+
20: ftp data
32+
21: ftp access
33+
22: ssh
34+
23: telnet
35+
25: smtp
36+
37: time
37+
42: name
38+
43: nicname
39+
53: domain
40+
69: tftp
41+
77: priv-rjs
42+
79: finger
43+
87: ttylink
44+
95: supdup
45+
101: hostname
46+
102: iso-tsap
47+
103: gppitnp
48+
104: acr-nema
49+
109: pop2
50+
110: pop3
51+
111: sunrpc
52+
113: auth
53+
115: sftp
54+
117: uucp-path
55+
119: nntp
56+
123: NTP
57+
135: loc-srv /epmap
58+
137: netbios
59+
139: netbios
60+
143: imap2
61+
161: snmp
62+
179: BGP
63+
389: ldap
64+
427: SLP (Also used by Apple Filing Protocol)
65+
465: smtp+ssl
66+
512: print / exec
67+
513: login
68+
514: shell
69+
515: printer
70+
526: tempo
71+
530: courier
72+
531: chat
73+
532: netnews
74+
540: uucp
75+
548: AFP (Apple Filing Protocol)
76+
554: rtsp
77+
556: remotefs
78+
563: nntp+ssl
79+
587: smtp (rfc6409)
80+
601: syslog-conn (rfc3195)
81+
636: ldap+ssl
82+
989: ftps-data
83+
990: ftps
84+
993: ldap+ssl
85+
995: pop3+ssl
86+
1719: h323gatestat
87+
1720: h323hostcall
88+
1723: pptp
89+
2049: nfs
90+
3659: apple-sasl / PasswordServer
91+
4045: lockd
92+
5060: sip
93+
5061: sips
94+
6000: X11
95+
6566: sane-port
96+
6665: Alternate IRC
97+
6666: Alternate IRC
98+
6667: Standard IRC
99+
6668: Alternate IRC
100+
6669: Alternate IRC
101+
6697: IRC + TLS
102+
10080: Amanda
103+
104+
For further information see:
105+
106+
[pull/23306](https://github.com/bitcoin/bitcoin/pull/23306#issuecomment-947516736)
107+
108+
[pull/23542](https://github.com/bitcoin/bitcoin/pull/23542)
109+
110+
[fetch.spec.whatwg.org](https://fetch.spec.whatwg.org/#port-blocking)
111+
112+
[chromium.googlesource.com](https://chromium.googlesource.com/chromium/src.git/+/refs/heads/main/net/base/port_util.cc)
113+
114+
[hg.mozilla.org](https://hg.mozilla.org/mozilla-central/file/tip/netwerk/base/nsIOService.cpp)

src/bitcoin-cli.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,8 @@ class NetinfoRequestHandler : public BaseRequestHandler
433433
bool is_addr_relay_enabled;
434434
bool is_bip152_hb_from;
435435
bool is_bip152_hb_to;
436-
bool is_block_relay;
437436
bool is_outbound;
437+
bool is_tx_relay;
438438
bool operator<(const Peer& rhs) const { return std::tie(is_outbound, min_ping) < std::tie(rhs.is_outbound, rhs.min_ping); }
439439
};
440440
std::vector<Peer> m_peers;
@@ -498,13 +498,13 @@ class NetinfoRequestHandler : public BaseRequestHandler
498498
const int8_t network_id{NetworkStringToId(network)};
499499
if (network_id == UNKNOWN_NETWORK) continue;
500500
const bool is_outbound{!peer["inbound"].get_bool()};
501-
const bool is_block_relay{peer["relaytxes"].isNull() ? false : !peer["relaytxes"].get_bool()};
501+
const bool is_tx_relay{peer["relaytxes"].isNull() ? true : peer["relaytxes"].get_bool()};
502502
const std::string conn_type{peer["connection_type"].get_str()};
503503
++m_counts.at(is_outbound).at(network_id); // in/out by network
504504
++m_counts.at(is_outbound).at(NETWORKS.size()); // in/out overall
505505
++m_counts.at(2).at(network_id); // total by network
506506
++m_counts.at(2).at(NETWORKS.size()); // total overall
507-
if (is_block_relay) ++m_block_relay_peers_count;
507+
if (conn_type == "block-relay-only") ++m_block_relay_peers_count;
508508
if (conn_type == "manual") ++m_manual_peers_count;
509509
if (DetailsRequested()) {
510510
// Push data for this peer to the peers vector.
@@ -527,7 +527,7 @@ class NetinfoRequestHandler : public BaseRequestHandler
527527
const bool is_addr_relay_enabled{peer["addr_relay_enabled"].isNull() ? false : peer["addr_relay_enabled"].get_bool()};
528528
const bool is_bip152_hb_from{peer["bip152_hb_from"].get_bool()};
529529
const bool is_bip152_hb_to{peer["bip152_hb_to"].get_bool()};
530-
m_peers.push_back({addr, sub_version, conn_type, NETWORK_SHORT_NAMES[network_id], age, transport, min_ping, ping, addr_processed, addr_rate_limited, last_blck, last_recv, last_send, last_trxn, peer_id, mapped_as, version, is_addr_relay_enabled, is_bip152_hb_from, is_bip152_hb_to, is_block_relay, is_outbound});
530+
m_peers.push_back({addr, sub_version, conn_type, NETWORK_SHORT_NAMES[network_id], age, transport, min_ping, ping, addr_processed, addr_rate_limited, last_blck, last_recv, last_send, last_trxn, peer_id, mapped_as, version, is_addr_relay_enabled, is_bip152_hb_from, is_bip152_hb_to, is_outbound, is_tx_relay});
531531
m_max_addr_length = std::max(addr.length() + 1, m_max_addr_length);
532532
m_max_addr_processed_length = std::max(ToString(addr_processed).length(), m_max_addr_processed_length);
533533
m_max_addr_rate_limited_length = std::max(ToString(addr_rate_limited).length(), m_max_addr_rate_limited_length);
@@ -561,7 +561,7 @@ class NetinfoRequestHandler : public BaseRequestHandler
561561
PingTimeToString(peer.ping),
562562
peer.last_send ? ToString(time_now - peer.last_send) : "",
563563
peer.last_recv ? ToString(time_now - peer.last_recv) : "",
564-
peer.last_trxn ? ToString((time_now - peer.last_trxn) / 60) : peer.is_block_relay ? "*" : "",
564+
peer.last_trxn ? ToString((time_now - peer.last_trxn) / 60) : peer.is_tx_relay ? "" : "*",
565565
peer.last_blck ? ToString((time_now - peer.last_blck) / 60) : "",
566566
strprintf("%s%s", peer.is_bip152_hb_to ? "." : " ", peer.is_bip152_hb_from ? "*" : " "),
567567
m_max_addr_processed_length, // variable spacing

src/compat/compat.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,6 @@ typedef char* sockopt_arg_type;
109109
#define USE_KQUEUE
110110
#endif
111111

112-
bool static inline IsSelectableSocket(const SOCKET& s) {
113-
#if defined(USE_POLL) || defined(WIN32)
114-
return true;
115-
#else
116-
return (s < FD_SETSIZE);
117-
#endif
118-
}
119-
120112
// MSG_NOSIGNAL is not available on some platforms, if it doesn't exist define it as 0
121113
#if !defined(MSG_NOSIGNAL)
122114
#define MSG_NOSIGNAL 0

src/init.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,8 @@ void SetupServerArgs(ArgsManager& argsman)
567567
argsman.AddArg("-txreconciliation", strprintf("Enable transaction reconciliations per BIP 330 (default: %d)", DEFAULT_TXRECONCILIATION_ENABLE), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CONNECTION);
568568
argsman.AddArg("-peertimeout=<n>", strprintf("Specify a p2p connection timeout delay in seconds. After connecting to a peer, wait this amount of time before considering disconnection based on inactivity (minimum: 1, default: %d)", DEFAULT_PEER_CONNECT_TIMEOUT), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
569569
argsman.AddArg("-permitbaremultisig", strprintf("Relay non-P2SH multisig (default: %u)", DEFAULT_PERMIT_BAREMULTISIG), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
570+
// TODO: remove the sentence "Nodes not using ... incoming connections." once the changes from
571+
// https://github.com/bitcoin/bitcoin/pull/23542 have become widespread.
570572
argsman.AddArg("-port=<port>", strprintf("Listen for connections on <port>. Nodes not using the default ports (default: %u, testnet: %u, regtest: %u) are unlikely to get incoming connections. Not relevant for I2P (see doc/i2p.md).", defaultChainParams->GetDefaultPort(), testnetChainParams->GetDefaultPort(), regtestChainParams->GetDefaultPort()), ArgsManager::ALLOW_ANY | ArgsManager::NETWORK_ONLY, OptionsCategory::CONNECTION);
571573
argsman.AddArg("-proxy=<ip:port>", "Connect through SOCKS5 proxy, set -noproxy to disable (default: disabled)", ArgsManager::ALLOW_ANY | ArgsManager::DISALLOW_ELISION, OptionsCategory::CONNECTION);
572574
argsman.AddArg("-proxyrandomize", strprintf("Randomize credentials for every proxy connection. This enables Tor stream isolation (default: %u)", DEFAULT_PROXYRANDOMIZE), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
@@ -2271,13 +2273,24 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
22712273
const uint16_t default_bind_port =
22722274
static_cast<uint16_t>(args.GetArg("-port", Params().GetDefaultPort()));
22732275

2276+
const auto BadPortWarning = [](const char* prefix, uint16_t port) {
2277+
return strprintf(_("%s request to listen on port %u. This port is considered \"bad\" and "
2278+
"thus it is unlikely that any Dash Core peers connect to it. See "
2279+
"doc/p2p-bad-ports.md for details and a full list."),
2280+
prefix,
2281+
port);
2282+
};
2283+
22742284
for (const std::string& bind_arg : args.GetArgs("-bind")) {
22752285
std::optional<CService> bind_addr;
22762286
const size_t index = bind_arg.rfind('=');
22772287
if (index == std::string::npos) {
22782288
bind_addr = Lookup(bind_arg, default_bind_port, /*fAllowLookup=*/false);
22792289
if (bind_addr.has_value()) {
22802290
connOptions.vBinds.push_back(bind_addr.value());
2291+
if (IsBadPort(bind_addr.value().GetPort())) {
2292+
InitWarning(BadPortWarning("-bind", bind_addr.value().GetPort()));
2293+
}
22812294
continue;
22822295
}
22832296
} else {
@@ -2305,6 +2318,15 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
23052318
// on any address - 0.0.0.0 (IPv4) and :: (IPv6).
23062319
connOptions.bind_on_any = args.GetArgs("-bind").empty() && args.GetArgs("-whitebind").empty();
23072320

2321+
// Emit a warning if a bad port is given to -port= but only if -bind and -whitebind are not
2322+
// given, because if they are, then -port= is ignored.
2323+
if (connOptions.bind_on_any && args.IsArgSet("-port")) {
2324+
const uint16_t port_arg = args.GetArg("-port", 0);
2325+
if (IsBadPort(port_arg)) {
2326+
InitWarning(BadPortWarning("-port", port_arg));
2327+
}
2328+
}
2329+
23082330
CService onion_service_target;
23092331
if (!connOptions.onion_binds.empty()) {
23102332
onion_service_target = connOptions.onion_binds.front();

src/masternode/node.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ void CActiveMasternodeManager::InitInternal(const CBlockIndex* pindex)
162162
LogPrintf("CActiveMasternodeManager::Init -- ERROR: %s\n", m_error);
163163
return;
164164
}
165-
bool fConnected = ConnectSocketDirectly(m_info.service, *sock, nConnectTimeout, true) && IsSelectableSocket(sock->Get());
165+
bool fConnected = ConnectSocketDirectly(m_info.service, *sock, nConnectTimeout, true) && sock->IsSelectable();
166166
sock->Reset();
167167

168168
if (!fConnected && Params().RequireRoutableExternalIP()) {

src/net.cpp

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2020,8 +2020,7 @@ void CConnman::CreateNodeFromAcceptedSocket(std::unique_ptr<Sock>&& sock,
20202020
return;
20212021
}
20222022

2023-
if (!IsSelectableSocket(sock->Get()))
2024-
{
2023+
if (!sock->IsSelectable()) {
20252024
LogPrintf("%s: non-selectable socket\n", strDropped);
20262025
return;
20272026
}
@@ -2306,10 +2305,11 @@ void CConnman::NotifyNumConnectionsChanged(CMasternodeSync& mn_sync)
23062305
mn_sync.Reset();
23072306
}
23082307

2309-
if(nodes_size != nPrevNodeCount) {
2308+
if (nodes_size != nPrevNodeCount) {
23102309
nPrevNodeCount = nodes_size;
2311-
if(clientInterface)
2312-
clientInterface->NotifyNumConnectionsChanged(nodes_size);
2310+
if (m_client_interface) {
2311+
m_client_interface->NotifyNumConnectionsChanged(nodes_size);
2312+
}
23132313

23142314
CalculateNumConnectionsChangedStats();
23152315
}
@@ -3140,6 +3140,12 @@ void CConnman::SetTryNewOutboundPeer(bool flag)
31403140
LogPrint(BCLog::NET, "net: setting try another outbound peer=%s\n", flag ? "true" : "false");
31413141
}
31423142

3143+
void CConnman::StartExtraBlockRelayPeers()
3144+
{
3145+
LogPrint(BCLog::NET, "net: enabling extra block-relay-only peers\n");
3146+
m_start_extra_block_relay_peers = true;
3147+
}
3148+
31433149
// Return the number of peers we have over our outbound connection limit
31443150
// Exclude peers that are marked for disconnect, or are going to be
31453151
// disconnected soon (eg ADDR_FETCH and FEELER)
@@ -3299,7 +3305,7 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect, CDe
32993305
// Therefore, we do not add them to addrman in the first place.
33003306
// In case previously unreachable networks become reachable
33013307
// (e.g. in case of -onlynet changes by the user), fixed seeds will
3302-
// be loaded only for networks for which we have no addressses.
3308+
// be loaded only for networks for which we have no addresses.
33033309
seed_addrs.erase(std::remove_if(seed_addrs.begin(), seed_addrs.end(),
33043310
[&fixed_seed_networks](const CAddress& addr) { return fixed_seed_networks.count(addr.GetNetwork()) == 0; }),
33053311
seed_addrs.end());
@@ -3542,12 +3548,26 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect, CDe
35423548
continue;
35433549
}
35443550

3545-
// Do not allow non-default ports, unless after 50 invalid
3546-
// addresses selected already. This is to prevent malicious peers
3547-
// from advertising themselves as a service on another host and
3548-
// port, causing a DoS attack as nodes around the network attempt
3549-
// to connect to it fruitlessly.
3550-
if ((!isMasternode || !Params().AllowMultiplePorts()) && addr.GetPort() != Params().GetDefaultPort(addr.GetNetwork()) && addr.GetPort() != GetListenPort() && nTries < 50) {
3551+
// Port validation in Dash has additional rules. Some networks are prohibited
3552+
// from using a non-default port while others allow any arbitary port so long
3553+
// it isn't a bad port (and in the case of masternodes, it matches its listen
3554+
// port)
3555+
const bool is_prohibited_port = [this, &addr, &isMasternode](){
3556+
if (!Params().AllowMultiplePorts()) {
3557+
const uint16_t default_port{Params().GetDefaultPort(addr.GetNetwork())};
3558+
assert(!IsBadPort(default_port)); // Make sure we never set the default port to a bad port
3559+
return addr.GetPort() != default_port;
3560+
}
3561+
const bool is_bad_port{IsBadPort(addr.GetPort())};
3562+
if (isMasternode) {
3563+
return addr.GetPort() != GetListenPort() || is_bad_port;
3564+
} else {
3565+
return is_bad_port;
3566+
}
3567+
}();
3568+
3569+
// Do not connect to prohibited ports, unless 50 invalid addresses have been selected already.
3570+
if (nTries < 50 && is_prohibited_port) {
35513571
continue;
35523572
}
35533573

@@ -4196,7 +4216,9 @@ void CConnman::SetNetworkActive(bool active, CMasternodeSync* const mn_sync)
41964216
mn_sync->Reset();
41974217
}
41984218

4199-
uiInterface.NotifyNetworkActiveChanged(fNetworkActive);
4219+
if (m_client_interface) {
4220+
m_client_interface->NotifyNetworkActiveChanged(fNetworkActive);
4221+
}
42004222
}
42014223

42024224
CConnman::CConnman(uint64_t nSeed0In, uint64_t nSeed1In, AddrMan& addrman_in,
@@ -4225,8 +4247,8 @@ bool CConnman::Bind(const CService& addr_, unsigned int flags, NetPermissionFlag
42254247

42264248
bilingual_str strError;
42274249
if (!BindListenPort(addr, strError, permissions)) {
4228-
if ((flags & BF_REPORT_ERROR) && clientInterface) {
4229-
clientInterface->ThreadSafeMessageBox(strError, "", CClientUIInterface::MSG_ERROR);
4250+
if ((flags & BF_REPORT_ERROR) && m_client_interface) {
4251+
m_client_interface->ThreadSafeMessageBox(strError, "", CClientUIInterface::MSG_ERROR);
42304252
}
42314253
return false;
42324254
}
@@ -4276,8 +4298,8 @@ bool CConnman::Start(CDeterministicMNManager& dmnman, CMasternodeMetaMan& mn_met
42764298
}
42774299

42784300
if (fListen && !InitBinds(connOptions)) {
4279-
if (clientInterface) {
4280-
clientInterface->ThreadSafeMessageBox(
4301+
if (m_client_interface) {
4302+
m_client_interface->ThreadSafeMessageBox(
42814303
_("Failed to listen on any port. Use -listen=0 if you want this."),
42824304
"", CClientUIInterface::MSG_ERROR);
42834305
}
@@ -4303,7 +4325,9 @@ bool CConnman::Start(CDeterministicMNManager& dmnman, CMasternodeMetaMan& mn_met
43034325
LogPrintf("%i block-relay-only anchors will be tried for connections.\n", m_anchors.size());
43044326
}
43054327

4306-
uiInterface.InitMessage(_("Starting network threads…").translated);
4328+
if (m_client_interface) {
4329+
m_client_interface->InitMessage(_("Starting network threads…").translated);
4330+
}
43074331

43084332
fAddressesInitialized = true;
43094333

@@ -4350,8 +4374,8 @@ bool CConnman::Start(CDeterministicMNManager& dmnman, CMasternodeMetaMan& mn_met
43504374
threadOpenAddedConnections = std::thread(&util::TraceThread, "addcon", [this] { ThreadOpenAddedConnections(); });
43514375

43524376
if (connOptions.m_use_addrman_outgoing && !connOptions.m_specified_outgoing.empty()) {
4353-
if (clientInterface) {
4354-
clientInterface->ThreadSafeMessageBox(
4377+
if (m_client_interface) {
4378+
m_client_interface->ThreadSafeMessageBox(
43554379
_("Cannot provide specific connections and have addrman find outgoing connections at the same time."),
43564380
"", CClientUIInterface::MSG_ERROR);
43574381
}

0 commit comments

Comments
 (0)