Skip to content

Commit 975b115

Browse files
committed
Merge bitcoin/bitcoin#31198: init: warn, don't error, when '-upnp' is set
a1b3cca init: warn, don't error, when '-upnp' is set (Antoine Poinsot) Pull request description: It prevented the GUI from starting when its settings.json had the -upnp option set. This also doesn't prevent the node from running, so this error didn't need to be fatal. Thanks to Sjors for bringing attention to what i broke and to Maflcko for suggesting a simple short term fix. Fixes #843. ACKs for top commit: maflcko: lgtm ACK a1b3cca kevkevinpal: Concept ACK [a1b3cca](bitcoin/bitcoin@a1b3cca) achow101: ACK a1b3cca tdb3: ACK a1b3cca Tree-SHA512: ceb1513bf532698e5143d64430a065f39626ef0d2708103ffc8ab7f81e8393f488af2350c5a299bc80f966add82a3951b4d81ae8b0e3070c0d15c94e8db4badd
2 parents 4a0251c + a1b3cca commit 975b115

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/init.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ void SetupServerArgs(ArgsManager& argsman, bool can_listen_ipc)
561561
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 | ArgsManager::DEBUG_ONLY, OptionsCategory::CONNECTION);
562562
argsman.AddArg("-torcontrol=<ip>:<port>", strprintf("Tor control host and port to use if onion listening enabled (default: %s). If no port is specified, the default port of %i will be used.", DEFAULT_TOR_CONTROL, DEFAULT_TOR_CONTROL_PORT), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
563563
argsman.AddArg("-torpassword=<pass>", "Tor control port password (default: empty)", ArgsManager::ALLOW_ANY | ArgsManager::SENSITIVE, OptionsCategory::CONNECTION);
564-
// UPnP support was dropped. We keep `-upnp` as a hidden arg to display a more user friendly error when set. TODO: remove (here and below) for 30.0.
564+
// UPnP support was dropped. We keep `-upnp` as a hidden arg to display a more user friendly error when set. TODO: remove (here and below) for 30.0. NOTE: removing this option may prevent the GUI from starting, see https://github.com/bitcoin-core/gui/issues/843.
565565
argsman.AddArg("-upnp", "", ArgsManager::ALLOW_ANY, OptionsCategory::HIDDEN);
566566
argsman.AddArg("-natpmp", strprintf("Use PCP or NAT-PMP to map the listening port (default: %u)", DEFAULT_NATPMP), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
567567
argsman.AddArg("-whitebind=<[permissions@]addr>", "Bind to the given address and add permission flags to the peers connecting to it. "
@@ -873,7 +873,7 @@ bool AppInitParameterInteraction(const ArgsManager& args)
873873
// We drop UPnP support but kept the arg as hidden for now to display a friendlier error to user who have the
874874
// option in their config. TODO: remove (here and above) for version 30.0.
875875
if (args.IsArgSet("-upnp")) {
876-
return InitError(_("UPnP support was dropped in version 29.0. Consider using '-natpmp' instead."));
876+
InitWarning(_("Option '-upnp' is set but UPnP support was dropped in version 29.0. Consider using '-natpmp' instead."));
877877
}
878878

879879
// Error if network-specific options (-addnode, -connect, etc) are

0 commit comments

Comments
 (0)